2008-02-08 11:10:45

by Guennadi Liakhovetski

[permalink] [raw]
Subject: [PATCH 2/2] Protect pca953x from being unloaded while its GPIOs are in use

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 <[email protected]>

---

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)