From f63af1fbad39f882d1fa3c2126fb96e14bf3702f Mon Sep 17 00:00:00 2001 From: Sang-Hun Lee Date: Mon, 9 Jun 2014 18:45:38 -0400 Subject: staging: iio: light: iqs253: cancel workqueue - Any lingering workqueue must be cancelled during the shutdown, to prevent them from running during a shutdown - In most cases, they are harmless, but they will trigger a warning if the i2c bus is shutdown during the shutdown as done on some platforms Bug 1522172 Change-Id: I465e19ef793cf72f5f533b0e2c9e9f3e837c2133 Signed-off-by: Sang-Hun Lee Reviewed-on: http://git-master/r/421345 (cherry picked from commit b04ebe7fc2a77897b0020412f2a1ab0de94aa7c1) Reviewed-on: http://git-master/r/422776 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Kerwin Wan Reviewed-by: Bharat Nihalani --- drivers/staging/iio/light/iqs253.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/staging') diff --git a/drivers/staging/iio/light/iqs253.c b/drivers/staging/iio/light/iqs253.c index ea7480105a34..d080b930cff0 100644 --- a/drivers/staging/iio/light/iqs253.c +++ b/drivers/staging/iio/light/iqs253.c @@ -820,6 +820,15 @@ static int iqs253_remove(struct i2c_client *client) static void iqs253_shutdown(struct i2c_client *client) { + struct iio_dev *indio_dev = i2c_get_clientdata(client); + struct iqs253_chip *chip = iio_priv(indio_dev); + +#if !defined(CONFIG_SENSORS_IQS253_AS_PROXIMITY) + if (chip->sar_wq) + cancel_delayed_work_sync(&chip->sar_dw); +#endif + if (chip->wq) + cancel_delayed_work_sync(&chip->dw); } -- cgit v1.2.3