summaryrefslogtreecommitdiff
path: root/drivers/hwmon/ams/ams-core.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-01-31 07:03:23 +0300
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-02-03 09:39:49 +0300
commit98ceb75c7c14eada76b0aa9f03a635a735cee3cb (patch)
treed514b307399db60cdbc1fd9461e8b5af5655ca0a /drivers/hwmon/ams/ams-core.c
parent33a470f6d5e1879c26f16f6b34dc09f82d44f6e9 (diff)
downloadlinux-98ceb75c7c14eada76b0aa9f03a635a735cee3cb.tar.xz
macintosh/hwmon/ams: Fix device removal sequence
Some code that is in ams_exit() (the module exit code) should instead be called when the device (not module) is removed. It probably doesn't make much of a difference in the PMU case, but in the I2C case it does matter. I make no guarantee that my fix isn't racy, I'm not familiar enough with the ams driver code to tell for sure. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Christian Kujau <lists@nerdbynature.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Stelian Pop <stelian@popies.net> Cc: Michael Hanselmann <linux-kernel@hansmi.ch> Cc: stable@kernel.org Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/hwmon/ams/ams-core.c')
-rw-r--r--drivers/hwmon/ams/ams-core.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/hwmon/ams/ams-core.c b/drivers/hwmon/ams/ams-core.c
index 6c9ace1b76f6..2ad62c339cd2 100644
--- a/drivers/hwmon/ams/ams-core.c
+++ b/drivers/hwmon/ams/ams-core.c
@@ -213,7 +213,7 @@ int __init ams_init(void)
return -ENODEV;
}
-void ams_exit(void)
+void ams_sensor_detach(void)
{
/* Remove input device */
ams_input_exit();
@@ -221,9 +221,6 @@ void ams_exit(void)
/* Remove attributes */
device_remove_file(&ams_info.of_dev->dev, &dev_attr_current);
- /* Shut down implementation */
- ams_info.exit();
-
/* Flush interrupt worker
*
* We do this after ams_info.exit(), because an interrupt might
@@ -239,6 +236,12 @@ void ams_exit(void)
pmf_unregister_irq_client(&ams_freefall_client);
}
+static void __exit ams_exit(void)
+{
+ /* Shut down implementation */
+ ams_info.exit();
+}
+
MODULE_AUTHOR("Stelian Pop, Michael Hanselmann");
MODULE_DESCRIPTION("Apple Motion Sensor driver");
MODULE_LICENSE("GPL");