diff mbox series

gpio: xgs-iproc: remove __exit annotation for iproc_gpio_remove

Message ID 20191210195414.705239-1-arnd@arndb.de
State Accepted
Commit 9cc7a18bcbd47e82960a059127497ab09c4abd05
Headers show
Series gpio: xgs-iproc: remove __exit annotation for iproc_gpio_remove | expand

Commit Message

Arnd Bergmann Dec. 10, 2019, 7:54 p.m. UTC
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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/gpio/gpio-xgs-iproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.20.0

Comments

Arnd Bergmann Dec. 10, 2019, 8:28 p.m. UTC | #1
On Tue, Dec 10, 2019 at 9:24 PM Chris Packham
<Chris.Packham@alliedtelesis.co.nz> wrote:
>

> On Tue, 2019-12-10 at 20:54 +0100, Arnd Bergmann wrote:

> > 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")

> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>

>

> Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

>

> 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
Bartosz Golaszewski Dec. 11, 2019, 9:14 a.m. UTC | #2
wt., 10 gru 2019 o 21:24 Chris Packham
<Chris.Packham@alliedtelesis.co.nz> napisaƂ(a):
>

> On Tue, 2019-12-10 at 20:54 +0100, Arnd Bergmann wrote:

> > 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")

> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>

>

> Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

>

> 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
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-xgs-iproc.c b/drivers/gpio/gpio-xgs-iproc.c
index 773e5c24309e..b21c2e436b61 100644
--- a/drivers/gpio/gpio-xgs-iproc.c
+++ b/drivers/gpio/gpio-xgs-iproc.c
@@ -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;