mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
[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>
This commit is contained in:
parent
65b1bfc13e
commit
557dca5f48
1 changed files with 11 additions and 1 deletions
|
@ -207,6 +207,16 @@ int amba_device_register(struct amba_device *dev, struct resource *parent)
|
||||||
void __iomem *tmp;
|
void __iomem *tmp;
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
|
device_initialize(&dev->dev);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copy from device_add
|
||||||
|
*/
|
||||||
|
if (dev->dev.init_name) {
|
||||||
|
dev_set_name(&dev->dev, "%s", dev->dev.init_name);
|
||||||
|
dev->dev.init_name = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
dev->dev.release = amba_device_release;
|
dev->dev.release = amba_device_release;
|
||||||
dev->dev.bus = &amba_bustype;
|
dev->dev.bus = &amba_bustype;
|
||||||
dev->dev.dma_mask = &dev->dma_mask;
|
dev->dev.dma_mask = &dev->dma_mask;
|
||||||
|
@ -240,7 +250,7 @@ int amba_device_register(struct amba_device *dev, struct resource *parent)
|
||||||
goto err_release;
|
goto err_release;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = device_register(&dev->dev);
|
ret = device_add(&dev->dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_release;
|
goto err_release;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue