Commit 9ecb839f authored by Alexander Usyskin's avatar Alexander Usyskin Committed by Greg Kroah-Hartman

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: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1274a690
...@@ -665,6 +665,10 @@ static int mei_cl_device_remove(struct device *dev) ...@@ -665,6 +665,10 @@ static int mei_cl_device_remove(struct device *dev)
if (!cldev || !dev->driver) if (!cldev || !dev->driver)
return 0; return 0;
cldrv = to_mei_cl_driver(dev->driver);
if (cldrv->remove)
ret = cldrv->remove(cldev);
if (cldev->rx_cb) { if (cldev->rx_cb) {
cancel_work_sync(&cldev->rx_work); cancel_work_sync(&cldev->rx_work);
cldev->rx_cb = NULL; cldev->rx_cb = NULL;
...@@ -674,10 +678,6 @@ static int mei_cl_device_remove(struct device *dev) ...@@ -674,10 +678,6 @@ static int mei_cl_device_remove(struct device *dev)
cldev->notif_cb = NULL; cldev->notif_cb = NULL;
} }
cldrv = to_mei_cl_driver(dev->driver);
if (cldrv->remove)
ret = cldrv->remove(cldev);
module_put(THIS_MODULE); module_put(THIS_MODULE);
dev->driver = NULL; dev->driver = NULL;
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment