From: 黄涛 Date: Thu, 31 May 2012 01:42:00 +0000 (+0800) Subject: lightsensor: cm3217: unregister earlysuspend when shutdown X-Git-Tag: firefly_0821_release~9142^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=517021c00de1a1027299dc4eaa10518c7aeb2905;p=firefly-linux-kernel-4.4.55.git lightsensor: cm3217: unregister earlysuspend when shutdown --- diff --git a/drivers/input/lightsensor/cm3217.c b/drivers/input/lightsensor/cm3217.c index e50ed235de2c..36fea403c6dc 100755 --- a/drivers/input/lightsensor/cm3217.c +++ b/drivers/input/lightsensor/cm3217.c @@ -345,10 +345,17 @@ static const struct i2c_device_id cm3217_id[] = { { "lightsensor", 0 }, }; +static void cm3217_shutdown(struct i2c_client *client) +{ +#ifdef CONFIG_HAS_EARLYSUSPEND + unregister_early_suspend(&cm3217_early_suspend); +#endif +} static struct i2c_driver cm3217_driver = { .probe = cm3217_probe, .remove = __devexit_p(cm3217_remove), + .shutdown = cm3217_shutdown, .id_table = cm3217_id, .driver = { .owner = THIS_MODULE,