mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
driver core: Suppress sysfs warnings for device_rename().
driver core: Suppress sysfs warnings for device_rename(). Renaming network devices to an already existing name is not something we want sysfs to print a scary warning for, since the callers can deal with this correctly. So let's introduce sysfs_create_link_nowarn() which gets rid of the common warning. Signed-off-by: Cornelia Huck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
0ad1d6f37c
commit
36ce6dad6e
5 changed files with 84 additions and 14 deletions
|
|
@ -1345,8 +1345,9 @@ int device_rename(struct device *dev, char *new_name)
|
|||
if (old_class_name) {
|
||||
new_class_name = make_class_name(dev->class->name, &dev->kobj);
|
||||
if (new_class_name) {
|
||||
error = sysfs_create_link(&dev->parent->kobj,
|
||||
&dev->kobj, new_class_name);
|
||||
error = sysfs_create_link_nowarn(&dev->parent->kobj,
|
||||
&dev->kobj,
|
||||
new_class_name);
|
||||
if (error)
|
||||
goto out;
|
||||
sysfs_remove_link(&dev->parent->kobj, old_class_name);
|
||||
|
|
@ -1354,8 +1355,8 @@ int device_rename(struct device *dev, char *new_name)
|
|||
}
|
||||
#else
|
||||
if (dev->class) {
|
||||
error = sysfs_create_link(&dev->class->p->class_subsys.kobj,
|
||||
&dev->kobj, dev->bus_id);
|
||||
error = sysfs_create_link_nowarn(&dev->class->p->class_subsys.kobj,
|
||||
&dev->kobj, dev->bus_id);
|
||||
if (error)
|
||||
goto out;
|
||||
sysfs_remove_link(&dev->class->p->class_subsys.kobj,
|
||||
|
|
|
|||
Loading…
Reference in a new issue