aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r--drivers/base/platform.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 6c743b6008d9..349a1013603f 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -24,7 +24,7 @@
24 driver)) 24 driver))
25 25
26struct device platform_bus = { 26struct device platform_bus = {
27 .bus_id = "platform", 27 .init_name = "platform",
28}; 28};
29EXPORT_SYMBOL_GPL(platform_bus); 29EXPORT_SYMBOL_GPL(platform_bus);
30 30
@@ -242,16 +242,15 @@ int platform_device_add(struct platform_device *pdev)
242 pdev->dev.bus = &platform_bus_type; 242 pdev->dev.bus = &platform_bus_type;
243 243
244 if (pdev->id != -1) 244 if (pdev->id != -1)
245 snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s.%d", pdev->name, 245 dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id);
246 pdev->id);
247 else 246 else
248 strlcpy(pdev->dev.bus_id, pdev->name, BUS_ID_SIZE); 247 dev_set_name(&pdev->dev, pdev->name);
249 248
250 for (i = 0; i < pdev->num_resources; i++) { 249 for (i = 0; i < pdev->num_resources; i++) {
251 struct resource *p, *r = &pdev->resource[i]; 250 struct resource *p, *r = &pdev->resource[i];
252 251
253 if (r->name == NULL) 252 if (r->name == NULL)
254 r->name = pdev->dev.bus_id; 253 r->name = dev_name(&pdev->dev);
255 254
256 p = r->parent; 255 p = r->parent;
257 if (!p) { 256 if (!p) {
@@ -264,14 +263,14 @@ int platform_device_add(struct platform_device *pdev)
264 if (p && insert_resource(p, r)) { 263 if (p && insert_resource(p, r)) {
265 printk(KERN_ERR 264 printk(KERN_ERR
266 "%s: failed to claim resource %d\n", 265 "%s: failed to claim resource %d\n",
267 pdev->dev.bus_id, i); 266 dev_name(&pdev->dev), i);
268 ret = -EBUSY; 267 ret = -EBUSY;
269 goto failed; 268 goto failed;
270 } 269 }
271 } 270 }
272 271
273 pr_debug("Registering platform device '%s'. Parent at %s\n", 272 pr_debug("Registering platform device '%s'. Parent at %s\n",
274 pdev->dev.bus_id, pdev->dev.parent->bus_id); 273 dev_name(&pdev->dev), dev_name(pdev->dev.parent));
275 274
276 ret = device_add(&pdev->dev); 275 ret = device_add(&pdev->dev);
277 if (ret == 0) 276 if (ret == 0)
@@ -607,7 +606,7 @@ static int platform_match(struct device *dev, struct device_driver *drv)
607 struct platform_device *pdev; 606 struct platform_device *pdev;
608 607
609 pdev = container_of(dev, struct platform_device, dev); 608 pdev = container_of(dev, struct platform_device, dev);
610 return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0); 609 return (strcmp(pdev->name, drv->name) == 0);
611} 610}
612 611
613#ifdef CONFIG_PM_SLEEP 612#ifdef CONFIG_PM_SLEEP