Skip to contentSkip to conversation

drivers/power: add missing sysfs_remove_group() in pcf50633_mbc_remove()

PATCH Applied Axel Lin 3 participants 3 messages Sep 21, 2010 – Sep 23, 2010

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 drivers/power: add missing sysfs_remove_group() in pcf50633_mbc_remove()

sysfs entries should be removed when unload the module.

---
 drivers/power/pcf50633-charger.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/power/pcf50633-charger.c +1 -0
index 066f994..4fa52e1 100644
@@ -456,6 +456,7 @@ static int __devexit pcf50633_mbc_remove(struct platform_device *pdev)
 	for (i = 0; i < ARRAY_SIZE(mbc_irq_handlers); i++)
 		pcf50633_free_irq(mbc->pcf, mbc_irq_handlers[i]);
 
+	sysfs_remove_group(&pdev->dev.kobj, &mbc_attr_group);
 	power_supply_unregister(&mbc->usb);
 	power_supply_unregister(&mbc->adapter);
 	power_supply_unregister(&mbc->ac);
Signature · 1 line
1.7.2
#1 lore raw
Quoted 3 lines · Axel Lin

sysfs entries should be removed when unload the module.

Applied, thanks!

Quoted 16 lines
---
 drivers/power/pcf50633-charger.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/power/pcf50633-charger.c +1 -0
index 066f994..4fa52e1 100644
@@ -456,6 +456,7 @@ static int __devexit pcf50633_mbc_remove(struct platform_device *pdev)
 	for (i = 0; i < ARRAY_SIZE(mbc_irq_handlers); i++)
 		pcf50633_free_irq(mbc->pcf, mbc_irq_handlers[i]);
 
+	sysfs_remove_group(&pdev->dev.kobj, &mbc_attr_group);
 	power_supply_unregister(&mbc->usb);
 	power_supply_unregister(&mbc->adapter);
 	power_supply_unregister(&mbc->ac);
Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
#2 lore raw
Quoted 2 lines · On Wed, 22 Sep 2010 16:16:58 +0400 Anton Vorontsov <[email protected]>…
Quoted 1 line · Axel Lin

sysfs entries should be removed when unload the module.

I suspect this patch fixes a kernel crash, yes?

Quoted 3 lines
Quoted 1 line

Applied, thanks!

Please consider backporting it into earlier kernels too. Preferably done by adding a Cc: <[email protected]> to the changelog.