Messages in this thread | | | From | Arnd Bergmann <> | Date | Tue, 10 Dec 2019 21:28:15 +0100 | Subject | Re: [PATCH] gpio: xgs-iproc: remove __exit annotation for iproc_gpio_remove |
| |
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
| |