diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-07-05 17:39:08 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-07-05 17:39:08 -0400 |
commit | 557dca5f48a45df88a73e69ee0700cfd4e2358c9 (patch) | |
tree | a84d89d63e5b3a3bf72bbf7aaa0ac907ec5ce6a5 /drivers/amba | |
parent | 65b1bfc13e8f50034187e339aa12b81cd6785bd5 (diff) |
[ARM] amba: fix amba device resources
AMBA device resources were being reported as:
10004000-10004fff : <BAD>
This is because dev_name() was returning NULL prior to device_register.
Ensure that the struct device is properly initialized, and the name is
set before adding it to the device tree.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/amba')
-rw-r--r-- | drivers/amba/bus.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 3d763fdf99b7..246650673010 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
@@ -207,6 +207,16 @@ int amba_device_register(struct amba_device *dev, struct resource *parent) | |||
207 | void __iomem *tmp; | 207 | void __iomem *tmp; |
208 | int i, ret; | 208 | int i, ret; |
209 | 209 | ||
210 | device_initialize(&dev->dev); | ||
211 | |||
212 | /* | ||
213 | * Copy from device_add | ||
214 | */ | ||
215 | if (dev->dev.init_name) { | ||
216 | dev_set_name(&dev->dev, "%s", dev->dev.init_name); | ||
217 | dev->dev.init_name = NULL; | ||
218 | } | ||
219 | |||
210 | dev->dev.release = amba_device_release; | 220 | dev->dev.release = amba_device_release; |
211 | dev->dev.bus = &amba_bustype; | 221 | dev->dev.bus = &amba_bustype; |
212 | dev->dev.dma_mask = &dev->dma_mask; | 222 | dev->dev.dma_mask = &dev->dma_mask; |
@@ -240,7 +250,7 @@ int amba_device_register(struct amba_device *dev, struct resource *parent) | |||
240 | goto err_release; | 250 | goto err_release; |
241 | } | 251 | } |
242 | 252 | ||
243 | ret = device_register(&dev->dev); | 253 | ret = device_add(&dev->dev); |
244 | if (ret) | 254 | if (ret) |
245 | goto err_release; | 255 | goto err_release; |
246 | 256 | ||