History

HID: intel-ish-hid: Move driver registry functions

Move the driver registry with the ishtp bus to the common interface file, which clients can include. Also rename __ishtp_cl_driver_register() to ishtp_cl_driver_register() and removed define for ishtp_cl_driver_register.

Srinivas Pandruvada committed 7 years ago

Commit e00a8641 parent c2012ec4 files · +31 −31Browse files

Unified · Split

4 files
  1. drivers/hid/intel-ish-hid/ishtp-hid-client.c +1 −1
  2. drivers/hid/intel-ish-hid/ishtp/bus.c +4 −4
  3. drivers/hid/intel-ish-hid/ishtp/bus.h +1 −26
  4. include/linux/intel-ish-client-if.h +25 −0
drivers/hid/intel-ish-hid/ishtp-hid-client.c+1−1
@@ -953,7 +953,7 @@ static int __init ish_hid_init(void) · 952 unmodified lines
953953 int rv;
954954
955955 /* Register ISHTP client device driver with ISHTP Bus */
956− rv = ishtp_cl_driver_register(&hid_ishtp_cl_driver);
956+ rv = ishtp_cl_driver_register(&hid_ishtp_cl_driver, THIS_MODULE);
957957
958958 return rv;
959959
drivers/hid/intel-ish-hid/ishtp/bus.c+4−4
@@ -485,7 +485,7 @@ static void ishtp_bus_remove_device(struct ishtp_cl_device *device) · 484 unmodified lines
485485 }
486486
487487 /**
488− * __ishtp_cl_driver_register() - Client driver register
488+ * ishtp_cl_driver_register() - Client driver register
489489 * @driver: the client driver instance
490490 * @owner: Owner of this driver module
491491 *
@@ -494,8 +494,8 @@ static void ishtp_bus_remove_device(struct ishtp_cl_device *device) · 2 unmodified lines
494494 *
495495 * Return: Return value of driver_register or -ENODEV if not ready
496496 */
497−int __ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
498− struct module *owner)
497+int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
498+ struct module *owner)
499499 {
500500 int err;
501501
@@ -512,7 +512,7 @@ int __ishtp_cl_driver_register(struct ishtp_cl_driver *driver, · 10 unmodified lines
512512
513513 return 0;
514514 }
515−EXPORT_SYMBOL(__ishtp_cl_driver_register);
515+EXPORT_SYMBOL(ishtp_cl_driver_register);
516516
517517 /**
518518 * ishtp_cl_driver_unregister() - Client driver unregister
drivers/hid/intel-ish-hid/ishtp/bus.h+1−26
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717
1818 #include <linux/device.h>
1919 #include <linux/mod_devicetable.h>
20+#include <linux/intel-ish-client-if.h>
2021
2122 struct ishtp_cl;
2223 struct ishtp_cl_device;
@@ -52,26 +53,6 @@ struct ishtp_cl_device { · 29 unmodified lines
5253 void (*event_cb)(struct ishtp_cl_device *device);
5354 };
5455
55−/**
56− * struct ishtp_cl_device - ISHTP device handle
57− * @driver: driver instance on a bus
58− * @name: Name of the device for probe
59− * @probe: driver callback for device probe
60− * @remove: driver callback on device removal
61− *
62− * Client drivers defines to get probed/removed for ISHTP client device.
63− */
64−struct ishtp_cl_driver {
65− struct device_driver driver;
66− const char *name;
67− const guid_t *guid;
68− int (*probe)(struct ishtp_cl_device *dev);
69− int (*remove)(struct ishtp_cl_device *dev);
70− int (*reset)(struct ishtp_cl_device *dev);
71− const struct dev_pm_ops *pm;
72−};
73−
74−
7556 int ishtp_bus_new_client(struct ishtp_device *dev);
7657 void ishtp_remove_all_clients(struct ishtp_device *dev);
7758 int ishtp_cl_device_bind(struct ishtp_cl *cl);
@@ -105,12 +86,6 @@ void ishtp_get_device(struct ishtp_cl_device *); · 27 unmodified lines
10586 void ishtp_set_drvdata(struct ishtp_cl_device *cl_device, void *data);
10687 void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device);
10788
108−int __ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
109− struct module *owner);
110−#define ishtp_cl_driver_register(driver) \
111− __ishtp_cl_driver_register(driver, THIS_MODULE)
112−void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);
113−
11489 int ishtp_register_event_cb(struct ishtp_cl_device *device,
11590 void (*read_cb)(struct ishtp_cl_device *));
11691 int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const guid_t *cuuid);
include/linux/intel-ish-client-if.h+25−0
@@ -10,6 +10,31 @@ · 9 unmodified lines
1010
1111 struct ishtp_cl_device;
1212
13+/**
14+ * struct ishtp_cl_device - ISHTP device handle
15+ * @driver: driver instance on a bus
16+ * @name: Name of the device for probe
17+ * @probe: driver callback for device probe
18+ * @remove: driver callback on device removal
19+ *
20+ * Client drivers defines to get probed/removed for ISHTP client device.
21+ */
22+struct ishtp_cl_driver {
23+ struct device_driver driver;
24+ const char *name;
25+ const guid_t *guid;
26+ int (*probe)(struct ishtp_cl_device *dev);
27+ int (*remove)(struct ishtp_cl_device *dev);
28+ int (*reset)(struct ishtp_cl_device *dev);
29+ const struct dev_pm_ops *pm;
30+};
31+
32+int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
33+ struct module *owner);
34+void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);
35+int ishtp_register_event_cb(struct ishtp_cl_device *device,
36+ void (*read_cb)(struct ishtp_cl_device *));
37+
1338 /* Get the device * from ishtp device instance */
1439 struct device *ishtp_device(struct ishtp_cl_device *cl_device);
1540 /* Trace interface for clients */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t