summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2010-04-30 09:45:51 -0600
committerJonathan Corbet <corbet@lwn.net>2010-05-07 17:17:40 -0600
commit27fe971d08b43f649358745a55f3c48ac6f413f8 (patch)
treeb9ac11243bb57db206952f81e5b596f2108a8140 /drivers/video
parent2b78a963c800252a0016785813cc5140c006145c (diff)
downloadblackbird-obmc-linux-27fe971d08b43f649358745a55f3c48ac6f413f8.tar.gz
blackbird-obmc-linux-27fe971d08b43f649358745a55f3c48ac6f413f8.zip
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')
-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)
unsigned long flags;
int ret = 0, i;
- spin_lock_irqsave(&gpio_config.vdev->reg_lock, flags);
/*
* Get unregistered.
*/
@@ -254,16 +253,16 @@ static int viafb_gpio_remove(struct platform_device *platdev)
ret = gpiochip_remove(&gpio_config.gpio_chip);
if (ret) { /* Somebody still using it? */
printk(KERN_ERR "Viafb: GPIO remove failed\n");
- goto out;
+ return ret;
}
}
/*
* Disable the ports.
*/
+ spin_lock_irqsave(&gpio_config.vdev->reg_lock, flags);
for (i = 0; i < gpio_config.gpio_chip.ngpio; i += 2)
viafb_gpio_disable(gpio_config.active_gpios[i]);
gpio_config.gpio_chip.ngpio = 0;
-out:
spin_unlock_irqrestore(&gpio_config.vdev->reg_lock, flags);
return ret;
}
OpenPOWER on IntegriCloud