mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
73fcdc9e15
commit
438d8908b3
2 changed files with 14 additions and 3 deletions
|
@ -17,6 +17,7 @@
|
|||
#endif
|
||||
|
||||
struct seq_file;
|
||||
struct module;
|
||||
|
||||
/**
|
||||
* struct gpio_chip - abstract a GPIO controller
|
||||
|
@ -48,6 +49,7 @@ struct seq_file;
|
|||
*/
|
||||
struct gpio_chip {
|
||||
char *label;
|
||||
struct module *owner;
|
||||
|
||||
int (*direction_input)(struct gpio_chip *chip,
|
||||
unsigned offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue