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:
Cornelia Huck 2008-06-10 11:09:08 +02:00 • committed by Greg Kroah-Hartman
commit 36ce6dad6e
5 changed files with 84 additions and 14 deletions

View file

@ -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,