From: Guennadi Liakhovetski <[EMAIL PROTECTED]>

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 <[EMAIL PROTECTED]>
[ add mcp23s08 and pcf857x ]
Signed-off-by: David Brownell <[EMAIL PROTECTED]>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to