summaryrefslogtreecommitdiff
path: root/drivers/misc/mei
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2017-01-27 17:32:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-31 13:07:43 +0300
commit9ecb839f16a353e71175981a098842fda4ddc7f1 (patch)
tree1be230436cf469ba9b1d949956b02bf452f766a2 /drivers/misc/mei
parent1274a690f6b2bd2b37447c47e3062afa8aa43f93 (diff)
downloadlinux-9ecb839f16a353e71175981a098842fda4ddc7f1.tar.xz
mei: bus: cancel and disable callback after release call
A driver on the mei bus may rely on the availability of the receive callback during driver remove() call, e.g. mei_wdt. Move callbacks dismantling after the remove() call to unblock that scenario. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei')
-rw-r--r--drivers/misc/mei/bus.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 2d9c5dd06e42..3bb1f1500f6b 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -665,6 +665,10 @@ static int mei_cl_device_remove(struct device *dev)
if (!cldev || !dev->driver)
return 0;
+ cldrv = to_mei_cl_driver(dev->driver);
+ if (cldrv->remove)
+ ret = cldrv->remove(cldev);
+
if (cldev->rx_cb) {
cancel_work_sync(&cldev->rx_work);
cldev->rx_cb = NULL;
@@ -674,10 +678,6 @@ static int mei_cl_device_remove(struct device *dev)
cldev->notif_cb = NULL;
}
- cldrv = to_mei_cl_driver(dev->driver);
- if (cldrv->remove)
- ret = cldrv->remove(cldev);
-
module_put(THIS_MODULE);
dev->driver = NULL;
return ret;