aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Kagstrom <simon.kagstrom@gmail.com>2008-11-19 17:10:51 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:10:51 +0000
commit7ab4c76ca35913d2e200d813356c8dbb03683619 (patch)
tree558585d958c9574d15c6afbbce1974073913bf09 /drivers
parent465eaf6dab5e100567887d41a3402ad43471e24e (diff)
lis302dl-allow-unloading-module.patch
This patch fixes module unloading for the accelerometer (actually module loading failed before). The two problems were that the interrupt was not unregistered, and that the device was left in a "strange" state. Signed-off-by: Simon Kagstrom <simon.kagstrom@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/misc/lis302dl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/input/misc/lis302dl.c b/drivers/input/misc/lis302dl.c
index 553a731097b..944e5ebcccf 100644
--- a/drivers/input/misc/lis302dl.c
+++ b/drivers/input/misc/lis302dl.c
@@ -462,11 +462,15 @@ static int __devexit lis302dl_remove(struct spi_device *spi)
struct lis302dl_info *lis = dev_get_drvdata(&spi->dev);
unsigned long flags;
- /* power down the device */
+ /* Reset and power down the device */
local_save_flags(flags);
+ reg_write(lis, LIS302DL_REG_CTRL3, 0x00);
+ reg_write(lis, LIS302DL_REG_CTRL2, 0x00);
reg_write(lis, LIS302DL_REG_CTRL1, 0x00);
local_irq_restore(flags);
+ /* Cleanup resources */
+ free_irq(lis->spi_dev->irq, lis);
sysfs_remove_group(&spi->dev.kobj, &lis302dl_attr_group);
input_unregister_device(lis->input_dev);
if (lis->input_dev)