[patch 52/53] PNP: fill in generic pnp_dev fields earlier

From: Bjorn Helgaas
Date: Fri Apr 18 2008 - 17:14:17 EST


This makes dev_printk() work better because we have a default driver.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@xxxxxx>

Index: work8/drivers/pnp/core.c
===================================================================
--- work8.orig/drivers/pnp/core.c 2008-04-17 15:05:18.000000000 -0600
+++ work8/drivers/pnp/core.c 2008-04-17 17:13:12.000000000 -0600
@@ -132,8 +132,13 @@
INIT_LIST_HEAD(&dev->resources);
dev->protocol = protocol;
dev->number = id;
+ dev->dma_mask = DMA_24BIT_MASK;

dev->dev.parent = &dev->protocol->dev;
+ dev->dev.bus = &pnp_bus_type;
+ dev->dev.dma_mask = &dev->dma_mask;
+ dev->dev.coherent_dma_mask = dev->dma_mask;
+ dev->dev.release = &pnp_release_device;
sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number,
dev->number);

@@ -151,10 +156,6 @@
int ret;

pnp_fixup_device(dev);
- dev->dev.bus = &pnp_bus_type;
- dev->dev.dma_mask = &dev->dma_mask;
- dev->dma_mask = dev->dev.coherent_dma_mask = DMA_24BIT_MASK;
- dev->dev.release = &pnp_release_device;
dev->status = PNP_READY;
spin_lock(&pnp_lock);
list_add_tail(&dev->global_list, &pnp_global);

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/