Commit 27fe971d authored by Jonathan Corbet's avatar Jonathan Corbet

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: default avatarBruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 2b78a963
...@@ -246,7 +246,6 @@ static int viafb_gpio_remove(struct platform_device *platdev) ...@@ -246,7 +246,6 @@ static int viafb_gpio_remove(struct platform_device *platdev)
unsigned long flags; unsigned long flags;
int ret = 0, i; int ret = 0, i;
spin_lock_irqsave(&gpio_config.vdev->reg_lock, flags);
/* /*
* Get unregistered. * Get unregistered.
*/ */
...@@ -254,16 +253,16 @@ static int viafb_gpio_remove(struct platform_device *platdev) ...@@ -254,16 +253,16 @@ static int viafb_gpio_remove(struct platform_device *platdev)
ret = gpiochip_remove(&gpio_config.gpio_chip); ret = gpiochip_remove(&gpio_config.gpio_chip);
if (ret) { /* Somebody still using it? */ if (ret) { /* Somebody still using it? */
printk(KERN_ERR "Viafb: GPIO remove failed\n"); printk(KERN_ERR "Viafb: GPIO remove failed\n");
goto out; return ret;
} }
} }
/* /*
* Disable the ports. * Disable the ports.
*/ */
spin_lock_irqsave(&gpio_config.vdev->reg_lock, flags);
for (i = 0; i < gpio_config.gpio_chip.ngpio; i += 2) for (i = 0; i < gpio_config.gpio_chip.ngpio; i += 2)
viafb_gpio_disable(gpio_config.active_gpios[i]); viafb_gpio_disable(gpio_config.active_gpios[i]);
gpio_config.gpio_chip.ngpio = 0; gpio_config.gpio_chip.ngpio = 0;
out:
spin_unlock_irqrestore(&gpio_config.vdev->reg_lock, flags); spin_unlock_irqrestore(&gpio_config.vdev->reg_lock, flags);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment