Skip to contentSkip to conversation

gpio: xgs-iproc: remove __exit annotation for iproc_gpio_remove

PATCH In review Arnd Bergmann 3 participants 4 messages Dec 10, 2019 – Dec 11, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: xgs-iproc: remove __exit annotation for iproc_gpio_remove

When built into the kernel, the driver causes a link problem:

iproc_gpio_remove' referenced in section .data' of drivers/gpio/gpio-xgs-iproc.o: defined in discarded section `.exit.text' of drivers/gpio/gpio-xgs-iproc.o

Remove the incorrect annotation.

Fixes 6a41b6c5fc20 ("gpio: Add xgs-iproc driver")
---
 drivers/gpio/gpio-xgs-iproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-xgs-iproc.c +1 -1
index 773e5c24309e..b21c2e436b61 100644
@@ -280,7 +280,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __exit iproc_gpio_remove(struct platform_device *pdev)
+static int iproc_gpio_remove(struct platform_device *pdev)
 {
 	struct iproc_gpio_chip *chip;
 
Signature · 7 lines
2.20.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Arnd Bergmann

When built into the kernel, the driver causes a link problem:

iproc_gpio_remove' referenced in section .data' of drivers/gpio/gpio-xgs-iproc.o: defined in discarded section `.exit.text' of drivers/gpio/gpio-xgs-iproc.o

Remove the incorrect annotation.

Fixes 6a41b6c5fc20 ("gpio: Add xgs-iproc driver")

What's the current best practice w.r.t.__init and __exit? I seem to have messed this up on multiple fronts.

Quoted 17 lines
---
 drivers/gpio/gpio-xgs-iproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-xgs-iproc.c +1 -1
index 773e5c24309e..b21c2e436b61 100644
@@ -280,7 +280,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __exit iproc_gpio_remove(struct platform_device *pdev)
+static int iproc_gpio_remove(struct platform_device *pdev)
 {
 	struct iproc_gpio_chip *chip;
 
#2 lore raw
Quoted 8 lines · Chris Packham
Quoted 6 lines · Arnd Bergmann

When built into the kernel, the driver causes a link problem:

iproc_gpio_remove' referenced in section .data' of drivers/gpio/gpio-xgs-iproc.o: defined in discarded section `.exit.text' of drivers/gpio/gpio-xgs-iproc.o

Remove the incorrect annotation.

Quoted 7 lines
Quoted 2 lines
Fixes 6a41b6c5fc20 ("gpio: Add xgs-iproc driver")

What's the current best practice w.r.t.__init and __exit? I seem to have messed this up on multiple fronts.

These are used for anything that is a module_init() function or a module_exit() function, or called from one, but generally not for any callbacks.

In particular the probe() and remove() callbacks of a device driver can get called at runtime when the device is hotplugged through sysfs.

Arnd

#3 lore raw
In reply to Chris Packham

wt., 10 gru 2019 o 21:24 Chris Packham
<[email protected]> napisał(a):

Quoted 8 lines · Arnd Bergmann
Quoted 6 lines

When built into the kernel, the driver causes a link problem:

iproc_gpio_remove' referenced in section .data' of drivers/gpio/gpio-xgs-iproc.o: defined in discarded section `.exit.text' of drivers/gpio/gpio-xgs-iproc.o

Remove the incorrect annotation.

Quoted 8 lines
Quoted 2 lines
Fixes 6a41b6c5fc20 ("gpio: Add xgs-iproc driver")

What's the current best practice w.r.t.__init and __exit? I seem to have messed this up on multiple fronts.

Applied for fixes.

Bartosz