From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: jikos@kernel.org
Cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, Even Xu <even.xu@intel.com>
Subject: [PATCH 1/9] hid: intel-ish-hid: ishtp: add helper function for driver data get/set
Date: Tue, 11 Sep 2018 16:44:13 -0700 [thread overview]
Message-ID: <20180911234421.10691-2-srinivas.pandruvada@linux.intel.com> (raw)
In-Reply-To: <20180911234421.10691-1-srinivas.pandruvada@linux.intel.com>
From: Even Xu <even.xu@intel.com>
Add helper function ishtp_set_drvdata() and ishtp_get_drvdata() for
different ISH client drivers to set/get private driver data.
Signed-off-by: Even Xu <even.xu@intel.com>
Reviewed-by: Andriy Shevchenko <andriy.shevchenko@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/hid/intel-ish-hid/ishtp/bus.c | 27 +++++++++++++++++++++++++++
drivers/hid/intel-ish-hid/ishtp/bus.h | 3 +++
2 files changed, 30 insertions(+)
diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index 2623a567ffba..d5db5e96e4a1 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -563,6 +563,33 @@ void ishtp_put_device(struct ishtp_cl_device *cl_device)
}
EXPORT_SYMBOL(ishtp_put_device);
+/**
+ * ishtp_set_drvdata() - set client driver data
+ * @cl_device: client device instance
+ * @data: driver data need to be set
+ *
+ * Set client driver data to cl_device->driver_data.
+ */
+void ishtp_set_drvdata(struct ishtp_cl_device *cl_device, void *data)
+{
+ cl_device->driver_data = data;
+}
+EXPORT_SYMBOL(ishtp_set_drvdata);
+
+/**
+ * ishtp_get_drvdata() - get client driver data
+ * @cl_device: client device instance
+ *
+ * Get client driver data from cl_device->driver_data.
+ *
+ * Return: pointer of driver data
+ */
+void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device)
+{
+ return cl_device->driver_data;
+}
+EXPORT_SYMBOL(ishtp_get_drvdata);
+
/**
* ishtp_bus_new_client() - Create a new client
* @dev: ISHTP device instance
diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.h b/drivers/hid/intel-ish-hid/ishtp/bus.h
index a1ffae7f26ad..88883311667e 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.h
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.h
@@ -101,6 +101,9 @@ void ishtp_reset_compl_handler(struct ishtp_device *dev);
void ishtp_put_device(struct ishtp_cl_device *);
void ishtp_get_device(struct ishtp_cl_device *);
+void ishtp_set_drvdata(struct ishtp_cl_device *cl_device, void *data);
+void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device);
+
int __ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
struct module *owner);
#define ishtp_cl_driver_register(driver) \
--
2.17.1
next prev parent reply other threads:[~2018-09-11 23:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-11 23:44 [PATCH 0/9] HID: intel ISH: Cleanup patches Srinivas Pandruvada
2018-09-11 23:44 ` Srinivas Pandruvada [this message]
2018-09-11 23:44 ` [PATCH 2/9] hid: intel-ish-hid: use helper function for private driver data set/get Srinivas Pandruvada
2018-09-11 23:44 ` [PATCH 3/9] hid: intel-ish-hid: ishtp: add helper functions for client buffer operation Srinivas Pandruvada
2018-09-11 23:44 ` [PATCH 4/9] hid: intel-ish-hid: use helper function to access client buffer Srinivas Pandruvada
2018-09-11 23:44 ` [PATCH 5/9] hid: intel-ish-hid: ishtp: add helper function for client search Srinivas Pandruvada
2018-09-11 23:44 ` [PATCH 6/9] hid: intel-ish-hid: use helper function to search client id Srinivas Pandruvada
2018-09-11 23:44 ` [PATCH 7/9] HID: intel_ish-hid: Enhance API to get ring buffer sizes Srinivas Pandruvada
2018-09-11 23:44 ` [PATCH 8/9] HID: intel-ish-hid: use resource-managed api Srinivas Pandruvada
2018-09-11 23:44 ` [PATCH 9/9] HID: intel-ish-hid: using list_head for ipc write queue Srinivas Pandruvada
2018-09-24 9:21 ` [PATCH 0/9] HID: intel ISH: Cleanup patches Jiri Kosina
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=20180911234421.10691-2-srinivas.pandruvada@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=benjamin.tissoires@redhat.com \
--cc=even.xu@intel.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).