mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers: base: core: Removed superfluous calls to put_device in device_destroy and to kobject deletion functions in device_del.
@ 2013-07-21 15:34 David Graham White
  2013-07-21 15:59 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: David Graham White @ 2013-07-21 15:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, David Graham White

When device_destroy is called and the device's embedded kobject may be removed,
this would occur with the call to put_device in device_unregister. Further,
put_device should take care of cleaning up the kobject without the need to
call kobject_del indepenedently in device_del.

Signed-off-by: David Graham White <dgwhite11@gmail.com>
---
 drivers/base/core.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 8856d74..d6494ee 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1292,9 +1292,7 @@ void device_del(struct device *dev)
 	 */
 	if (platform_notify_remove)
 		platform_notify_remove(dev);
-	kobject_uevent(&dev->kobj, KOBJ_REMOVE);
 	cleanup_device_parent(dev);
-	kobject_del(&dev->kobj);
 	put_device(parent);
 }
 
@@ -1849,10 +1847,8 @@ void device_destroy(struct class *class, dev_t devt)
 	struct device *dev;
 
 	dev = class_find_device(class, NULL, &devt, __match_devt);
-	if (dev) {
-		put_device(dev);
+	if (dev)
 		device_unregister(dev);
-	}
 }
 EXPORT_SYMBOL_GPL(device_destroy);
 
-- 
1.8.3.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-21 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-21 15:34 [PATCH] drivers: base: core: Removed superfluous calls to put_device in device_destroy and to kobject deletion functions in device_del David Graham White
2013-07-21 15:59 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome