LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [patch 2.6.25-rc1 2/3] gpiolib: i2c/spi drivers handler rmmod better
@ 2008-02-11  0:22 David Brownell
  0 siblings, 0 replies; only message in thread
From: David Brownell @ 2008-02-11  0:22 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml, Guennadi Liakhovetski

From: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>

Use the newly introduced owner field in struct gpio_chip to protect 
the current (small) set of non-SOC GPIO drivers from being unloaded
while any of their GPIOs are in use.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
[ add mcp23s08 and pcf857x ]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
 drivers/gpio/mcp23s08.c |    1 +
 drivers/gpio/pca953x.c  |    1 +
 drivers/gpio/pcf857x.c  |    1 +
 3 files changed, 3 insertions(+)

--- g26.orig/drivers/gpio/mcp23s08.c	2008-02-10 16:06:30.000000000 -0800
+++ g26/drivers/gpio/mcp23s08.c	2008-02-10 16:09:52.000000000 -0800
@@ -239,6 +239,7 @@ static int mcp23s08_probe(struct spi_dev
 	mcp->chip.base = pdata->base;
 	mcp->chip.ngpio = 8;
 	mcp->chip.can_sleep = 1;
+	mcp->chip.owner = THIS_MODULE;
 
 	spi_set_drvdata(spi, mcp);
 
--- g26.orig/drivers/gpio/pca953x.c	2008-02-10 16:06:30.000000000 -0800
+++ g26/drivers/gpio/pca953x.c	2008-02-10 16:09:52.000000000 -0800
@@ -188,6 +188,7 @@ static void pca953x_setup_gpio(struct pc
 	gc->base = chip->gpio_start;
 	gc->ngpio = gpios;
 	gc->label = chip->client->name;
+	gc->owner = THIS_MODULE;
 }
 
 static int __devinit pca953x_probe(struct i2c_client *client)
--- g26.orig/drivers/gpio/pcf857x.c	2008-02-10 16:06:30.000000000 -0800
+++ g26/drivers/gpio/pcf857x.c	2008-02-10 16:09:52.000000000 -0800
@@ -159,6 +159,7 @@ static int pcf857x_probe(struct i2c_clie
 
 	gpio->chip.base = pdata->gpio_base;
 	gpio->chip.can_sleep = 1;
+	gpio->chip.owner = THIS_MODULE;
 
 	/* NOTE:  the OnSemi jlc1562b is also largely compatible with
 	 * these parts, notably for output.  It has a low-resolution


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-11  0:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-11  0:22 [patch 2.6.25-rc1 2/3] gpiolib: i2c/spi drivers handler rmmod better David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).