[PATCH 2/2] Protect pca953x from being unloaded while its GPIOs arein use

From: Guennadi Liakhovetski
Date: Fri Feb 08 2008 - 06:10:46 EST


This uses the newly introduced owner field in struct gpio_chip to protect
pca953x from being unloaded as long as its GPIOs are in use.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxxxxxxxxxx>

---

diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
index 0bd594d..89cee66 100644
--- a/drivers/gpio/pca953x.c
+++ b/drivers/gpio/pca953x.c
@@ -188,6 +188,7 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/