From: Tomas Winkler <tomas.winkler@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alexander Usyskin <alexander.usyskin@intel.com>,
linux-kernel@vger.kernel.org,
Tomas Winkler <tomas.winkler@intel.com>
Subject: [char-misc-next 5/8] mei: bus: export mei_cldev_enabled function
Date: Thu, 10 Sep 2015 10:18:03 +0300 [thread overview]
Message-ID: <1441869486-2792-6-git-send-email-tomas.winkler@intel.com> (raw)
In-Reply-To: <1441869486-2792-1-git-send-email-tomas.winkler@intel.com>
Let me client device driver query of the device is connected
and hence enabled.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
drivers/misc/mei/bus.c | 13 +++++++++++++
include/linux/mei_cl_bus.h | 1 +
2 files changed, 14 insertions(+)
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 53525ca50337..4edf71acfed6 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -368,6 +368,19 @@ u8 mei_cldev_ver(const struct mei_cl_device *cldev)
EXPORT_SYMBOL_GPL(mei_cldev_ver);
/**
+ * mei_cldev_enabled - check whether the device is enabled
+ *
+ * @cldev: mei client device
+ *
+ * Return: true if me client is initialized and connected
+ */
+bool mei_cldev_enabled(struct mei_cl_device *cldev)
+{
+ return cldev->cl && mei_cl_is_connected(cldev->cl);
+}
+EXPORT_SYMBOL_GPL(mei_cldev_enabled);
+
+/**
* mei_cl_enable_device - enable me client device
* create connection with me client
*
diff --git a/include/linux/mei_cl_bus.h b/include/linux/mei_cl_bus.h
index 9834f832b098..30d1c8b94a27 100644
--- a/include/linux/mei_cl_bus.h
+++ b/include/linux/mei_cl_bus.h
@@ -93,5 +93,6 @@ void mei_cl_set_drvdata(struct mei_cl_device *device, void *data);
int mei_cl_enable_device(struct mei_cl_device *device);
int mei_cl_disable_device(struct mei_cl_device *device);
+bool mei_cldev_enabled(struct mei_cl_device *cldev);
#endif /* _LINUX_MEI_CL_BUS_H */
--
2.4.3
next prev parent reply other threads:[~2015-09-10 7:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-10 7:17 [char-misc-next 0/8] mei: mei client bus enhancements Tomas Winkler
2015-09-10 7:17 ` [char-misc-next 1/8 V2] mei: make modules.alias UUID information easier to read Tomas Winkler
2015-09-10 7:18 ` [char-misc-next 2/8] mei: bus: export client protocol version Tomas Winkler
2015-09-10 7:18 ` [char-misc-next 3/8] mei: bus: add client protocol version to the device alias Tomas Winkler
2015-09-10 7:18 ` [char-misc-next 4/8] mei: bus: export uuid and protocol version to mei_cl bus drivers Tomas Winkler
2015-09-10 7:18 ` Tomas Winkler [this message]
2015-09-10 7:18 ` [char-misc-next 6/8] mei: bus: complete variable rename of type struct mei_cl_device Tomas Winkler
2015-09-10 7:18 ` [char-misc-next 7/8] mei: bus: use mei_cldev_ prefix for the API functions Tomas Winkler
2015-09-10 7:18 ` [char-misc-next 8/8] mei: bus: use mei_cl_bus_ prefix consistently Tomas Winkler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441869486-2792-6-git-send-email-tomas.winkler@intel.com \
--to=tomas.winkler@intel.com \
--cc=alexander.usyskin@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®