diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/class.c | 1 | ||||
-rw-r--r-- | drivers/base/core.c | 8 | ||||
-rw-r--r-- | drivers/base/memory.c | 2 | ||||
-rw-r--r-- | drivers/base/sys.c | 3 |
4 files changed, 6 insertions, 8 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index 0ef00e8d4153..e085af0ff94f 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -140,7 +140,6 @@ int class_register(struct class *cls) | |||
140 | 140 | ||
141 | pr_debug("device class '%s': registering\n", cls->name); | 141 | pr_debug("device class '%s': registering\n", cls->name); |
142 | 142 | ||
143 | INIT_LIST_HEAD(&cls->children); | ||
144 | INIT_LIST_HEAD(&cls->devices); | 143 | INIT_LIST_HEAD(&cls->devices); |
145 | INIT_LIST_HEAD(&cls->interfaces); | 144 | INIT_LIST_HEAD(&cls->interfaces); |
146 | kset_init(&cls->class_dirs); | 145 | kset_init(&cls->class_dirs); |
diff --git a/drivers/base/core.c b/drivers/base/core.c index be288b5e4180..3eeac5a78581 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -1218,13 +1218,11 @@ int device_rename(struct device *dev, char *new_name) | |||
1218 | } | 1218 | } |
1219 | #else | 1219 | #else |
1220 | if (dev->class) { | 1220 | if (dev->class) { |
1221 | sysfs_remove_link(&dev->class->subsys.kobj, old_device_name); | ||
1222 | error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj, | 1221 | error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj, |
1223 | dev->bus_id); | 1222 | dev->bus_id); |
1224 | if (error) { | 1223 | if (error) |
1225 | dev_err(dev, "%s: sysfs_create_symlink failed (%d)\n", | 1224 | goto out; |
1226 | __func__, error); | 1225 | sysfs_remove_link(&dev->class->subsys.kobj, old_device_name); |
1227 | } | ||
1228 | } | 1226 | } |
1229 | #endif | 1227 | #endif |
1230 | 1228 | ||
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 8ce6de5a7e28..937e8258981d 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
@@ -53,11 +53,13 @@ int register_memory_notifier(struct notifier_block *nb) | |||
53 | { | 53 | { |
54 | return blocking_notifier_chain_register(&memory_chain, nb); | 54 | return blocking_notifier_chain_register(&memory_chain, nb); |
55 | } | 55 | } |
56 | EXPORT_SYMBOL(register_memory_notifier); | ||
56 | 57 | ||
57 | void unregister_memory_notifier(struct notifier_block *nb) | 58 | void unregister_memory_notifier(struct notifier_block *nb) |
58 | { | 59 | { |
59 | blocking_notifier_chain_unregister(&memory_chain, nb); | 60 | blocking_notifier_chain_unregister(&memory_chain, nb); |
60 | } | 61 | } |
62 | EXPORT_SYMBOL(unregister_memory_notifier); | ||
61 | 63 | ||
62 | /* | 64 | /* |
63 | * register_memory - Setup a sysfs device for a memory block | 65 | * register_memory - Setup a sysfs device for a memory block |
diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 4fbb56bcb1ee..358bb0be3c08 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c | |||
@@ -175,8 +175,7 @@ int sysdev_driver_register(struct sysdev_class *cls, struct sysdev_driver *drv) | |||
175 | } | 175 | } |
176 | 176 | ||
177 | /* Check whether this driver has already been added to a class. */ | 177 | /* Check whether this driver has already been added to a class. */ |
178 | if ((drv->entry.next != drv->entry.prev) || | 178 | if (drv->entry.next && !list_empty(&drv->entry)) { |
179 | (drv->entry.next != NULL)) { | ||
180 | printk(KERN_WARNING "sysdev: class %s: driver (%p) has already" | 179 | printk(KERN_WARNING "sysdev: class %s: driver (%p) has already" |
181 | " been registered to a class, something is wrong, but " | 180 | " been registered to a class, something is wrong, but " |
182 | "will forge on!\n", cls->name, drv); | 181 | "will forge on!\n", cls->name, drv); |