Skip to contentSkip to conversation

Protect pca953x from being unloaded while its GPIOs are in use

PATCH In review Guennadi Liakhovetski 1 participant 1 message Feb 8, 2008 GPIO

lore
Share & tools
lore
#0 lore raw

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.

---

drivers/gpio/pca953x.c +1 -0
index 0bd594d..89cee66 100644
@@ -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)