summaryrefslogtreecommitdiffstats
path: root/drivers/staging/android
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2012-04-26 22:01:10 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-29 21:36:35 -0400
commitd9a861d55e0cf60829956d7c6e18b7de0b02ab92 (patch)
tree4e7309adb08f52f75add060da7602fe259049ace /drivers/staging/android
parentacbaa0bf052a363de640725972563a34d61cfb82 (diff)
downloadblackbird-obmc-linux-d9a861d55e0cf60829956d7c6e18b7de0b02ab92.tar.gz
blackbird-obmc-linux-d9a861d55e0cf60829956d7c6e18b7de0b02ab92.zip
staging: android: timed_output : disable the timed output device when the device is unregistered
(Life cycle of timed output device driver) 1) register the device as the timed output 2) enable() ops is called via the sysfs timeout > 0 : timer is activated and device is turned on timeout = 0 : timer is cancelled and device is off 3) unregister the timed output device if not used any more So the registered device should be disabled explicitly when the module is removed. ('disabled' means the timer is stopped and the device is turned off) Rather than implementing that code in each driver, just call enable() with timeout = 0 to clean up the driver. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Cc: Mike Lockwood <lockwood@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android')
-rw-r--r--drivers/staging/android/timed_output.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/android/timed_output.c b/drivers/staging/android/timed_output.c
index f373422308e0..38d930cadad3 100644
--- a/drivers/staging/android/timed_output.c
+++ b/drivers/staging/android/timed_output.c
@@ -99,6 +99,7 @@ EXPORT_SYMBOL_GPL(timed_output_dev_register);
void timed_output_dev_unregister(struct timed_output_dev *tdev)
{
+ tdev->enable(tdev, 0);
device_remove_file(tdev->dev, &dev_attr_enable);
device_destroy(timed_output_class, MKDEV(0, tdev->index));
dev_set_drvdata(tdev->dev, NULL);
OpenPOWER on IntegriCloud