diff options
author | Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> | 2008-04-28 05:14:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:34 -0400 |
commit | 438d8908b379b6322fc3b28d45c9ebdddf58bc20 (patch) | |
tree | ce9439dc8c7e5d9e80f514751fb3b4ce4e414233 /include/asm-generic/gpio.h | |
parent | 73fcdc9e15c27bb92595c611c8938a36645ea20d (diff) |
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>
Diffstat (limited to 'include/asm-generic/gpio.h')
-rw-r--r-- | include/asm-generic/gpio.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index f29a502f4a6c..7e77b6ff45bb 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | struct seq_file; | 19 | struct seq_file; |
20 | struct module; | ||
20 | 21 | ||
21 | /** | 22 | /** |
22 | * struct gpio_chip - abstract a GPIO controller | 23 | * struct gpio_chip - abstract a GPIO controller |
@@ -48,6 +49,7 @@ struct seq_file; | |||
48 | */ | 49 | */ |
49 | struct gpio_chip { | 50 | struct gpio_chip { |
50 | char *label; | 51 | char *label; |
52 | struct module *owner; | ||
51 | 53 | ||
52 | int (*direction_input)(struct gpio_chip *chip, | 54 | int (*direction_input)(struct gpio_chip *chip, |
53 | unsigned offset); | 55 | unsigned offset); |