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
953 int rv;953 int rv;
954 954
955 /* Register ISHTP client device driver with ISHTP Bus */955 /* 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);
957 957
958 return rv;958 return rv;
959 959
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
485}485}
486 486
487/**487/**
488 * __ishtp_cl_driver_register() - Client driver register488 * ishtp_cl_driver_register() - Client driver register
489 * @driver: the client driver instance489 * @driver: the client driver instance
490 * @owner: Owner of this driver module490 * @owner: Owner of this driver module
491 *491 *
@@ -494,8 +494,8 @@ static void ishtp_bus_remove_device(struct ishtp_cl_device *device) · 2 unmodified lines
494 *494 *
495 * Return: Return value of driver_register or -ENODEV if not ready495 * Return: Return value of driver_register or -ENODEV if not ready
496 */496 */
497int __ishtp_cl_driver_register(struct ishtp_cl_driver *driver,497int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
498 struct module *owner)498 struct module *owner)
499{499{
500 int err;500 int err;
501 501
@@ -512,7 +512,7 @@ int __ishtp_cl_driver_register(struct ishtp_cl_driver *driver, · 10 unmodified lines
512 512
513 return 0;513 return 0;
514}514}
515EXPORT_SYMBOL(__ishtp_cl_driver_register);515EXPORT_SYMBOL(ishtp_cl_driver_register);
516 516
517/**517/**
518 * ishtp_cl_driver_unregister() - Client driver unregister518 * ishtp_cl_driver_unregister() - Client driver unregister
drivers/hid/intel-ish-hid/ishtp/bus.h+1−26
@@ -17,6 +17,7 @@ · 16 unmodified lines
17 17
18#include <linux/device.h>18#include <linux/device.h>
19#include <linux/mod_devicetable.h>19#include <linux/mod_devicetable.h>
20#include <linux/intel-ish-client-if.h>
20 21
21struct ishtp_cl;22struct ishtp_cl;
22struct ishtp_cl_device;23struct ishtp_cl_device;
@@ -52,26 +53,6 @@ struct ishtp_cl_device { · 29 unmodified lines
52 void (*event_cb)(struct ishtp_cl_device *device);53 void (*event_cb)(struct ishtp_cl_device *device);
53};54};
54 55
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 */
64struct 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
75int ishtp_bus_new_client(struct ishtp_device *dev);56int ishtp_bus_new_client(struct ishtp_device *dev);
76void ishtp_remove_all_clients(struct ishtp_device *dev);57void ishtp_remove_all_clients(struct ishtp_device *dev);
77int ishtp_cl_device_bind(struct ishtp_cl *cl);58int ishtp_cl_device_bind(struct ishtp_cl *cl);
@@ -105,12 +86,6 @@ void ishtp_get_device(struct ishtp_cl_device *); · 27 unmodified lines
105void ishtp_set_drvdata(struct ishtp_cl_device *cl_device, void *data);86void ishtp_set_drvdata(struct ishtp_cl_device *cl_device, void *data);
106void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device);87void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device);
107 88
108int __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)
112void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);
113
114int ishtp_register_event_cb(struct ishtp_cl_device *device,89int ishtp_register_event_cb(struct ishtp_cl_device *device,
115 void (*read_cb)(struct ishtp_cl_device *));90 void (*read_cb)(struct ishtp_cl_device *));
116int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const guid_t *cuuid);91int 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
10 10
11struct ishtp_cl_device;11struct ishtp_cl_device;
12 12
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 */
22struct 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
32int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
33 struct module *owner);
34void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);
35int ishtp_register_event_cb(struct ishtp_cl_device *device,
36 void (*read_cb)(struct ishtp_cl_device *));
37
13/* Get the device * from ishtp device instance */38/* Get the device * from ishtp device instance */
14struct device *ishtp_device(struct ishtp_cl_device *cl_device);39struct device *ishtp_device(struct ishtp_cl_device *cl_device);
15/* Trace interface for clients */40/* 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