Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1165470 > unrolled thread

[char-misc-next 06/15 V2] mei: bus: report if event registration failed

Started byTomas Winkler <tomas.winkler@intel.com>
First post2015-06-15 21:10 +0200
Last post2015-06-15 21:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [char-misc-next 06/15 V2] mei: bus: report if event registration failed Tomas Winkler <tomas.winkler@intel.com> - 2015-06-15 21:10 +0200

#1165470 — [char-misc-next 06/15 V2] mei: bus: report if event registration failed

FromTomas Winkler <tomas.winkler@intel.com>
Date2015-06-15 21:10 +0200
Subject[char-misc-next 06/15 V2] mei: bus: report if event registration failed
Message-ID<pBHVE-40I-1@gated-at.bofh.it>
If event registeration has failed, the caller should know
about it.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
V2: fix the commit message

 drivers/misc/mei/bus.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 3756f4687292..e32913289c87 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -255,6 +255,8 @@ void mei_cl_bus_rx_event(struct mei_cl *cl)
 int mei_cl_register_event_cb(struct mei_cl_device *cldev,
 			  mei_cl_event_cb_t event_cb, void *context)
 {
+	int ret;
+
 	if (cldev->event_cb)
 		return -EALREADY;
 
@@ -263,7 +265,9 @@ int mei_cl_register_event_cb(struct mei_cl_device *cldev,
 	cldev->event_context = context;
 	INIT_WORK(&cldev->event_work, mei_bus_event_work);
 
-	mei_cl_read_start(cldev->cl, 0, NULL);
+	ret = mei_cl_read_start(cldev->cl, 0, NULL);
+	if (ret && ret != -EBUSY)
+		return ret;
 
 	return 0;
 }
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web