aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-10 00:58:28 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-10 00:58:28 -0500
commit271368b69b9e8042063d6c713423e84503bbdaa0 (patch)
tree71d9c592d8b92bee80a03d2de74d1763b1282076
parent117430b1fa3ae0b0bd981226bdb0c5412729c1db (diff)
parent9e993efb0da827634778554070f3c3ec4bdade33 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: kobject: new_device->kref wasn't putted after error in kobject_move() driver core: export device_rename Remove devfs from MAINTAINERS Driver core: add device symlink back to sysfs Revert "driver core: refcounting fix"
-rw-r--r--MAINTAINERS3
-rw-r--r--drivers/base/core.c23
-rw-r--r--kernel/module.c6
-rw-r--r--lib/kobject.c2
4 files changed, 16 insertions, 18 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 9993b9009415..17555bba20af 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1103,9 +1103,6 @@ W: http://lanana.org/docs/device-list/index.html
1103L: linux-kernel@vger.kernel.org 1103L: linux-kernel@vger.kernel.org
1104S: Maintained 1104S: Maintained
1105 1105
1106DEVICE FILESYSTEM
1107S: Obsolete
1108
1109DIGI INTL. EPCA DRIVER 1106DIGI INTL. EPCA DRIVER
1110P: Digi International, Inc 1107P: Digi International, Inc
1111M: Eng.Linux@digi.com 1108M: Eng.Linux@digi.com
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 89ebe3682726..f191afe62b4d 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -584,17 +584,17 @@ int device_add(struct device *dev)
584 if (dev->kobj.parent != &dev->class->subsys.kset.kobj) 584 if (dev->kobj.parent != &dev->class->subsys.kset.kobj)
585 sysfs_create_link(&dev->class->subsys.kset.kobj, 585 sysfs_create_link(&dev->class->subsys.kset.kobj,
586 &dev->kobj, dev->bus_id); 586 &dev->kobj, dev->bus_id);
587#ifdef CONFIG_SYSFS_DEPRECATED
588 if (parent) { 587 if (parent) {
589 sysfs_create_link(&dev->kobj, &dev->parent->kobj, 588 sysfs_create_link(&dev->kobj, &dev->parent->kobj,
590 "device"); 589 "device");
590#ifdef CONFIG_SYSFS_DEPRECATED
591 class_name = make_class_name(dev->class->name, 591 class_name = make_class_name(dev->class->name,
592 &dev->kobj); 592 &dev->kobj);
593 if (class_name) 593 if (class_name)
594 sysfs_create_link(&dev->parent->kobj, 594 sysfs_create_link(&dev->parent->kobj,
595 &dev->kobj, class_name); 595 &dev->kobj, class_name);
596 }
597#endif 596#endif
597 }
598 } 598 }
599 599
600 if ((error = device_add_attrs(dev))) 600 if ((error = device_add_attrs(dev)))
@@ -651,17 +651,17 @@ int device_add(struct device *dev)
651 if (dev->kobj.parent != &dev->class->subsys.kset.kobj) 651 if (dev->kobj.parent != &dev->class->subsys.kset.kobj)
652 sysfs_remove_link(&dev->class->subsys.kset.kobj, 652 sysfs_remove_link(&dev->class->subsys.kset.kobj,
653 dev->bus_id); 653 dev->bus_id);
654#ifdef CONFIG_SYSFS_DEPRECATED
655 if (parent) { 654 if (parent) {
655#ifdef CONFIG_SYSFS_DEPRECATED
656 char *class_name = make_class_name(dev->class->name, 656 char *class_name = make_class_name(dev->class->name,
657 &dev->kobj); 657 &dev->kobj);
658 if (class_name) 658 if (class_name)
659 sysfs_remove_link(&dev->parent->kobj, 659 sysfs_remove_link(&dev->parent->kobj,
660 class_name); 660 class_name);
661 kfree(class_name); 661 kfree(class_name);
662#endif
662 sysfs_remove_link(&dev->kobj, "device"); 663 sysfs_remove_link(&dev->kobj, "device");
663 } 664 }
664#endif
665 665
666 down(&dev->class->sem); 666 down(&dev->class->sem);
667 /* notify any interfaces that the device is now gone */ 667 /* notify any interfaces that the device is now gone */
@@ -761,17 +761,17 @@ void device_del(struct device * dev)
761 if (dev->kobj.parent != &dev->class->subsys.kset.kobj) 761 if (dev->kobj.parent != &dev->class->subsys.kset.kobj)
762 sysfs_remove_link(&dev->class->subsys.kset.kobj, 762 sysfs_remove_link(&dev->class->subsys.kset.kobj,
763 dev->bus_id); 763 dev->bus_id);
764#ifdef CONFIG_SYSFS_DEPRECATED
765 if (parent) { 764 if (parent) {
765#ifdef CONFIG_SYSFS_DEPRECATED
766 char *class_name = make_class_name(dev->class->name, 766 char *class_name = make_class_name(dev->class->name,
767 &dev->kobj); 767 &dev->kobj);
768 if (class_name) 768 if (class_name)
769 sysfs_remove_link(&dev->parent->kobj, 769 sysfs_remove_link(&dev->parent->kobj,
770 class_name); 770 class_name);
771 kfree(class_name); 771 kfree(class_name);
772#endif
772 sysfs_remove_link(&dev->kobj, "device"); 773 sysfs_remove_link(&dev->kobj, "device");
773 } 774 }
774#endif
775 775
776 down(&dev->class->sem); 776 down(&dev->class->sem);
777 /* notify any interfaces that the device is now gone */ 777 /* notify any interfaces that the device is now gone */
@@ -1065,14 +1065,14 @@ int device_rename(struct device *dev, char *new_name)
1065 1065
1066 return error; 1066 return error;
1067} 1067}
1068 1068EXPORT_SYMBOL_GPL(device_rename);
1069 1069
1070static int device_move_class_links(struct device *dev, 1070static int device_move_class_links(struct device *dev,
1071 struct device *old_parent, 1071 struct device *old_parent,
1072 struct device *new_parent) 1072 struct device *new_parent)
1073{ 1073{
1074 int error = 0;
1074#ifdef CONFIG_SYSFS_DEPRECATED 1075#ifdef CONFIG_SYSFS_DEPRECATED
1075 int error;
1076 char *class_name; 1076 char *class_name;
1077 1077
1078 class_name = make_class_name(dev->class->name, &dev->kobj); 1078 class_name = make_class_name(dev->class->name, &dev->kobj);
@@ -1100,7 +1100,12 @@ out:
1100 kfree(class_name); 1100 kfree(class_name);
1101 return error; 1101 return error;
1102#else 1102#else
1103 return 0; 1103 if (old_parent)
1104 sysfs_remove_link(&dev->kobj, "device");
1105 if (new_parent)
1106 error = sysfs_create_link(&dev->kobj, &new_parent->kobj,
1107 "device");
1108 return error;
1104#endif 1109#endif
1105} 1110}
1106 1111
diff --git a/kernel/module.c b/kernel/module.c
index f77e893e4620..fbc51de6444e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2419,12 +2419,6 @@ void module_remove_driver(struct device_driver *drv)
2419 kfree(driver_name); 2419 kfree(driver_name);
2420 } 2420 }
2421 } 2421 }
2422 /*
2423 * Undo the additional reference we added in module_add_driver()
2424 * via kset_find_obj()
2425 */
2426 if (drv->mod_name)
2427 kobject_put(&drv->kobj);
2428} 2422}
2429EXPORT_SYMBOL(module_remove_driver); 2423EXPORT_SYMBOL(module_remove_driver);
2430#endif 2424#endif
diff --git a/lib/kobject.c b/lib/kobject.c
index f4f6176dcd12..057921c5945a 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -385,9 +385,11 @@ int kobject_move(struct kobject *kobj, struct kobject *new_parent)
385 goto out; 385 goto out;
386 old_parent = kobj->parent; 386 old_parent = kobj->parent;
387 kobj->parent = new_parent; 387 kobj->parent = new_parent;
388 new_parent = NULL;
388 kobject_put(old_parent); 389 kobject_put(old_parent);
389 kobject_uevent_env(kobj, KOBJ_MOVE, envp); 390 kobject_uevent_env(kobj, KOBJ_MOVE, envp);
390out: 391out:
392 kobject_put(new_parent);
391 kobject_put(kobj); 393 kobject_put(kobj);
392 kfree(devpath_string); 394 kfree(devpath_string);
393 kfree(devpath); 395 kfree(devpath);