driver core: struct device - replace bus_id with dev_name(), dev_set_name()
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
210272a284
commit
1e0b2cf933
@@ -24,7 +24,7 @@
|
||||
driver))
|
||||
|
||||
struct device platform_bus = {
|
||||
.bus_id = "platform",
|
||||
.init_name = "platform",
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(platform_bus);
|
||||
|
||||
@@ -242,16 +242,15 @@ int platform_device_add(struct platform_device *pdev)
|
||||
pdev->dev.bus = &platform_bus_type;
|
||||
|
||||
if (pdev->id != -1)
|
||||
snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s.%d", pdev->name,
|
||||
pdev->id);
|
||||
dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id);
|
||||
else
|
||||
strlcpy(pdev->dev.bus_id, pdev->name, BUS_ID_SIZE);
|
||||
dev_set_name(&pdev->dev, pdev->name);
|
||||
|
||||
for (i = 0; i < pdev->num_resources; i++) {
|
||||
struct resource *p, *r = &pdev->resource[i];
|
||||
|
||||
if (r->name == NULL)
|
||||
r->name = pdev->dev.bus_id;
|
||||
r->name = dev_name(&pdev->dev);
|
||||
|
||||
p = r->parent;
|
||||
if (!p) {
|
||||
@@ -264,14 +263,14 @@ int platform_device_add(struct platform_device *pdev)
|
||||
if (p && insert_resource(p, r)) {
|
||||
printk(KERN_ERR
|
||||
"%s: failed to claim resource %d\n",
|
||||
pdev->dev.bus_id, i);
|
||||
dev_name(&pdev->dev), i);
|
||||
ret = -EBUSY;
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
|
||||
pr_debug("Registering platform device '%s'. Parent at %s\n",
|
||||
pdev->dev.bus_id, pdev->dev.parent->bus_id);
|
||||
dev_name(&pdev->dev), dev_name(pdev->dev.parent));
|
||||
|
||||
ret = device_add(&pdev->dev);
|
||||
if (ret == 0)
|
||||
@@ -607,7 +606,7 @@ static int platform_match(struct device *dev, struct device_driver *drv)
|
||||
struct platform_device *pdev;
|
||||
|
||||
pdev = container_of(dev, struct platform_device, dev);
|
||||
return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0);
|
||||
return (strcmp(pdev->name, drv->name) == 0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
Reference in New Issue
Block a user