Skip to contentSkip to conversation

video: fbdev: pmag-ba-fb: remove incorrect __exit markups

PATCH In review Dmitry Torokhov 2 participants 2 messages Feb 25, 2017 – Mar 20, 2017 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: fbdev: pmag-ba-fb: remove incorrect __exit markups

Even if bus is not hot-pluggable, the devices can be unbound from the driver via sysfs, so we should not be using __exit annotations on remove() methods. The only exception is drivers registered with platform_driver_probe() which specifically disables sysfs bind/unbind attributes.

---
 drivers/video/fbdev/pmag-ba-fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/pmag-ba-fb.c +2 -2
index 5872bc4af3ce..f49317f137ec 100644
@@ -235,7 +235,7 @@ static int pmagbafb_probe(struct device *dev)
 	return err;
 }
 
-static int __exit pmagbafb_remove(struct device *dev)
+static int pmagbafb_remove(struct device *dev)
 {
 	struct tc_dev *tdev = to_tc_dev(dev);
 	struct fb_info *info = dev_get_drvdata(dev);
@@ -270,7 +270,7 @@ static struct tc_driver pmagbafb_driver = {
 		.name	= "pmagbafb",
 		.bus	= &tc_bus_type,
 		.probe	= pmagbafb_probe,
-		.remove	= __exit_p(pmagbafb_remove),
+		.remove	= pmagbafb_remove,
 	},
 };
 
Signature · 5 lines
2.11.0.483.g087da7b7c-goog


-- 
Dmitry
#1 lore raw
Quoted 7 lines · Dmitry Torokhov

Even if bus is not hot-pluggable, the devices can be unbound from the driver via sysfs, so we should not be using __exit annotations on remove() methods. The only exception is drivers registered with platform_driver_probe() which specifically disables sysfs bind/unbind attributes.

Patch queued for 4.12, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics