aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2010-04-30 11:45:51 -0400
committerJonathan Corbet <corbet@lwn.net>2010-05-07 19:17:40 -0400
commit27fe971d08b43f649358745a55f3c48ac6f413f8 (patch)
treeb9ac11243bb57db206952f81e5b596f2108a8140 /drivers/video/via
parent2b78a963c800252a0016785813cc5140c006145c (diff)
viafb: Do not remove gpiochip under spinlock
gpiochip_remove() is not meant to be called with interrupts disabled, and there is no need for the lock here in any case. Reported-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/video/via')
-rw-r--r--drivers/video/via/via-gpio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/video/via/via-gpio.c b/drivers/video/via/via-gpio.c
index 44537be1f070..63cb7acc0faf 100644
--- a/drivers/video/via/via-gpio.c
+++ b/drivers/video/via/via-gpio.c
@@ -246,7 +246,6 @@ static int viafb_gpio_remove(struct platform_device *platdev)
246 unsigned long flags; 246 unsigned long flags;
247 int ret = 0, i; 247 int ret = 0, i;
248 248
249 spin_lock_irqsave(&gpio_config.vdev->reg_lock, flags);
250 /* 249 /*
251 * Get unregistered. 250 * Get unregistered.
252 */ 251 */
@@ -254,16 +253,16 @@ static int viafb_gpio_remove(struct platform_device *platdev)
254 ret = gpiochip_remove(&gpio_config.gpio_chip); 253 ret = gpiochip_remove(&gpio_config.gpio_chip);
255 if (ret) { /* Somebody still using it? */ 254 if (ret) { /* Somebody still using it? */
256 printk(KERN_ERR "Viafb: GPIO remove failed\n"); 255 printk(KERN_ERR "Viafb: GPIO remove failed\n");
257 goto out; 256 return ret;
258 } 257 }
259 } 258 }
260 /* 259 /*
261 * Disable the ports. 260 * Disable the ports.
262 */ 261 */
262 spin_lock_irqsave(&gpio_config.vdev->reg_lock, flags);
263 for (i = 0; i < gpio_config.gpio_chip.ngpio; i += 2) 263 for (i = 0; i < gpio_config.gpio_chip.ngpio; i += 2)
264 viafb_gpio_disable(gpio_config.active_gpios[i]); 264 viafb_gpio_disable(gpio_config.active_gpios[i]);
265 gpio_config.gpio_chip.ngpio = 0; 265 gpio_config.gpio_chip.ngpio = 0;
266out:
267 spin_unlock_irqrestore(&gpio_config.vdev->reg_lock, flags); 266 spin_unlock_irqrestore(&gpio_config.vdev->reg_lock, flags);
268 return ret; 267 return ret;
269} 268}