aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/core.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index f861c2b1dcff..72eccae4904b 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1291,13 +1291,11 @@ int device_rename(struct device *dev, char *new_name)
1291 } 1291 }
1292#else 1292#else
1293 if (dev->class) { 1293 if (dev->class) {
1294 sysfs_remove_link(&dev->class->subsys.kobj, old_device_name);
1295 error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj, 1294 error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj,
1296 dev->bus_id); 1295 dev->bus_id);
1297 if (error) { 1296 if (error)
1298 dev_err(dev, "%s: sysfs_create_symlink failed (%d)\n", 1297 goto out;
1299 __func__, error); 1298 sysfs_remove_link(&dev->class->subsys.kobj, old_device_name);
1300 }
1301 } 1299 }
1302#endif 1300#endif
1303 1301