summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorDaniel Hung-yu Wu <hywu@google.com>2018-04-18 12:24:02 +0200
committerLee Jones <lee.jones@linaro.org>2018-05-29 09:10:54 +0100
commite15b7f44a224851ea9f03edca65596627913a445 (patch)
treec4cce3140a276e969d2fb92a063b30afaf848038 /drivers/mfd
parent95a4d07fdecbd52a2e683607d561a200d2522033 (diff)
downloadop-kernel-dev-e15b7f44a224851ea9f03edca65596627913a445.zip
op-kernel-dev-e15b7f44a224851ea9f03edca65596627913a445.tar.gz
mfd: cros_ec_dev: Register shutdown function for debugfs
Reboot or shutdown during delayed works could corrupt communication with EC and certain I2C controller may not be able to recover from the error state. This patch registers a shutdown callback used to cancel the debugfs log worker thread. Signed-off-by: Daniel Hung-yu Wu <hywu@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/cros_ec_dev.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
index a393b3c..1f88952 100644
--- a/drivers/mfd/cros_ec_dev.c
+++ b/drivers/mfd/cros_ec_dev.c
@@ -472,6 +472,14 @@ static int ec_device_remove(struct platform_device *pdev)
return 0;
}
+static void ec_device_shutdown(struct platform_device *pdev)
+{
+ struct cros_ec_dev *ec = dev_get_drvdata(&pdev->dev);
+
+ /* Be sure to clear up debugfs delayed works */
+ cros_ec_debugfs_remove(ec);
+}
+
static const struct platform_device_id cros_ec_id[] = {
{ DRV_NAME, 0 },
{ /* sentinel */ },
@@ -514,6 +522,7 @@ static struct platform_driver cros_ec_dev_driver = {
},
.probe = ec_device_probe,
.remove = ec_device_remove,
+ .shutdown = ec_device_shutdown,
};
static int __init cros_ec_dev_init(void)
OpenPOWER on IntegriCloud