linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] hid: intel-ish-hid: ishtp: add helper function for driver data get/set
@ 2016-12-23  1:22 Even Xu
  2016-12-23  1:22 ` [PATCH 2/7] hid: intel-ish-hid: use helper function for private driver data set/get Even Xu
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Even Xu @ 2016-12-23  1:22 UTC (permalink / raw)
  To: jikos, benjamin.tissoires, srinivas.pandruvada, arnd, gregkh,
	andriy.shevchenko
  Cc: linux-input, linux-kernel, Even Xu

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 2565215..40e13f1 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -562,6 +562,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 a1ffae7..8888331 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.7.4

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2017-01-05  5:39 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-23  1:22 [PATCH 1/7] hid: intel-ish-hid: ishtp: add helper function for driver data get/set Even Xu
2016-12-23  1:22 ` [PATCH 2/7] hid: intel-ish-hid: use helper function for private driver data set/get Even Xu
2016-12-23  1:22 ` [PATCH 3/7] hid: intel-ish-hid: ishtp: add helper functions for client buffer operation Even Xu
2016-12-23  1:22 ` [PATCH 4/7] hid: intel-ish-hid: use helper function to access client buffer Even Xu
2016-12-23  1:22 ` [PATCH 5/7] hid: intel-ish-hid: ishtp: add helper function for client search Even Xu
2016-12-23  1:22 ` [PATCH 6/7] hid: intel-ish-hid: use helper function to search client id Even Xu
2016-12-23  1:22 ` [PATCH 7/7] misc: intel-ish-client: add intel ishtp clients driver Even Xu
2017-01-03  9:54   ` Jiri Kosina
2017-01-04  6:55     ` Xu, Even
2017-01-04  9:36       ` Jiri Kosina
2017-01-04 12:59         ` gregkh
2017-01-04 13:03   ` Greg KH
2017-01-04 17:11     ` Srinivas Pandruvada
2017-01-04 17:18       ` Greg KH
2017-01-04 18:41         ` Srinivas Pandruvada
2017-01-04 19:40           ` Greg KH
2017-01-05  5:38             ` Xu, Even
2017-01-04 13:09   ` Greg KH
2017-01-04 13:13   ` Greg KH

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).