]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: better rmmod infrastructure
authorGuennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Mon, 28 Apr 2008 09:14:44 +0000 (02:14 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Apr 2008 15:58:34 +0000 (08:58 -0700)
commitb60e35f4ec5b1ae4dc7b07733edb88de40a27603
treece9439dc8c7e5d9e80f514751fb3b4ce4e414233
parent0ead8f8b045ee23700da4d1efc02d34b04184827
gpiolib: better rmmod infrastructure

As long as one or more GPIOs on a gpio chip are used its driver should not be
unloaded.  The existing mechanism (gpiochip_remove failure) doesn't address
that, since rmmod can no longer be made to fail by having the cleanup code
report errors.  Module usecounts are the solution.

Assuming standard "initialize struct to zero" policies, this change won't
affect SOC platform drivers.  However, drivers for external chips (on I2C and
SPI busses) should be updated if they can be built as modules.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
[ gpio_ensure_requested() needs to update module usecounts too ]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/gpio/gpiolib.c
include/asm-generic/gpio.h