From: Roman Tereshonkov Date: Tue, 10 Jun 2008 12:16:36 +0000 (+0300) Subject: This patch fixes "scheduling while atomic" bug when driver is unloaded. X-Git-Tag: v2.6.26-omap1~123^2~8 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e41b053caa92a74db7162050e540d84aef44270f;p=linux-2.6-omap-h63xx.git This patch fixes "scheduling while atomic" bug when driver is unloaded. Signed-off-by: Roman Tereshonkov Acked-by: Felipe Balbi Signed-off-by: Tony Lindgren --- diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index fa017996be7..408caf007d7 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c @@ -661,11 +661,10 @@ err1: static int __devexit tsc2005_remove(struct spi_device *spi) { struct tsc2005 *ts = dev_get_drvdata(&spi->dev); - unsigned long flags; - spin_lock_irqsave(&ts->lock, flags); + mutex_lock(&ts->mutex); tsc2005_disable(ts); - spin_unlock_irqrestore(&ts->lock, flags); + mutex_unlock(&ts->mutex); device_remove_file(&ts->spi->dev, &dev_attr_disable_ts); device_remove_file(&ts->spi->dev, &dev_attr_pen_down);