From e41b053caa92a74db7162050e540d84aef44270f Mon Sep 17 00:00:00 2001 From: Roman Tereshonkov Date: Tue, 10 Jun 2008 15:16:36 +0300 Subject: [PATCH] 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 --- drivers/input/touchscreen/tsc2005.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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); -- 2.41.1