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

Bjorn Helgaas
2008-04-18T20:52:43Z

[-- Attachment #1: pnp-init-pnp_dev-generic-stuff-earlier --]
[-- Type: text/plain, Size: 1119 bytes --]

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

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

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);

--