summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/mei_wdt.c
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2016-11-16 21:51:29 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-17 16:37:49 +0100
commit7c7a6077f5c7a35fc03a7f452875d8440dd1bc8d (patch)
treee495b143494b3a7b98ce1841d8cc3c2a5f97c2cf /drivers/watchdog/mei_wdt.c
parentmei: bus: make a client pointer always available (diff)
downloadlinux-7c7a6077f5c7a35fc03a7f452875d8440dd1bc8d.tar.xz
linux-7c7a6077f5c7a35fc03a7f452875d8440dd1bc8d.zip
mei: bus: split RX and async notification callbacks
Split callbacks for RX and async notification events on mei bus to eliminate synchronization problems and to open way for RX optimizations. 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/watchdog/mei_wdt.c')
-rw-r--r--drivers/watchdog/mei_wdt.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
index e0af52265511..79b35515904e 100644
--- a/drivers/watchdog/mei_wdt.c
+++ b/drivers/watchdog/mei_wdt.c
@@ -410,11 +410,11 @@ static void mei_wdt_unregister_work(struct work_struct *work)
}
/**
- * mei_wdt_event_rx - callback for data receive
+ * mei_wdt_rx - callback for data receive
*
* @cldev: bus device
*/
-static void mei_wdt_event_rx(struct mei_cl_device *cldev)
+static void mei_wdt_rx(struct mei_cl_device *cldev)
{
struct mei_wdt *wdt = mei_cldev_get_drvdata(cldev);
struct mei_wdt_start_response res;
@@ -482,11 +482,11 @@ out:
}
/*
- * mei_wdt_notify_event - callback for event notification
+ * mei_wdt_notif - callback for event notification
*
* @cldev: bus device
*/
-static void mei_wdt_notify_event(struct mei_cl_device *cldev)
+static void mei_wdt_notif(struct mei_cl_device *cldev)
{
struct mei_wdt *wdt = mei_cldev_get_drvdata(cldev);
@@ -496,21 +496,6 @@ static void mei_wdt_notify_event(struct mei_cl_device *cldev)
mei_wdt_register(wdt);
}
-/**
- * mei_wdt_event - callback for event receive
- *
- * @cldev: bus device
- * @events: event mask
- */
-static void mei_wdt_event(struct mei_cl_device *cldev, u32 events)
-{
- if (events & BIT(MEI_CL_EVENT_RX))
- mei_wdt_event_rx(cldev);
-
- if (events & BIT(MEI_CL_EVENT_NOTIF))
- mei_wdt_notify_event(cldev);
-}
-
#if IS_ENABLED(CONFIG_DEBUG_FS)
static ssize_t mei_dbgfs_read_activation(struct file *file, char __user *ubuf,
@@ -621,16 +606,17 @@ static int mei_wdt_probe(struct mei_cl_device *cldev,
goto err_out;
}
- ret = mei_cldev_register_event_cb(wdt->cldev,
- BIT(MEI_CL_EVENT_RX) |
- BIT(MEI_CL_EVENT_NOTIF),
- mei_wdt_event);
+ ret = mei_cldev_register_rx_cb(wdt->cldev, mei_wdt_rx);
+ if (ret) {
+ dev_err(&cldev->dev, "Could not reg rx event ret=%d\n", ret);
+ goto err_disable;
+ }
+ ret = mei_cldev_register_notif_cb(wdt->cldev, mei_wdt_notif);
/* on legacy devices notification is not supported
- * this doesn't fail the registration for RX event
*/
if (ret && ret != -EOPNOTSUPP) {
- dev_err(&cldev->dev, "Could not register event ret=%d\n", ret);
+ dev_err(&cldev->dev, "Could not reg notif event ret=%d\n", ret);
goto err_disable;
}