HID: intel-ish-hid: Switch to use new generic UUID API
Subsystems (2)
PATCH 1/1 HID: intel-ish-hid: Switch to use new generic UUID API
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
--- drivers/hid/intel-ish-hid/ishtp-hid-client.c | 3 +-- drivers/hid/intel-ish-hid/ishtp-hid.h | 6 +++--- drivers/hid/intel-ish-hid/ishtp/bus.c | 19 ++++++++----------- drivers/hid/intel-ish-hid/ishtp/bus.h | 4 ++-- drivers/hid/intel-ish-hid/ishtp/client.h | 2 +- drivers/hid/intel-ish-hid/ishtp/hbm.h | 2 +- 6 files changed, 16 insertions(+), 20 deletions(-)
drivers/hid/intel-ish-hid/ishtp-hid-client.c +1 -2
@@ -788,8 +788,7 @@ static int hid_ishtp_cl_probe(struct ishtp_cl_device *cl_device)if (!cl_device)return -ENODEV ; -if (uuid_le_cmp (hid_ishtp_guid, - cl_device->fw_client->props.protocol_name) !=0 ) +if (!guid_equal (&hid_ishtp_guid, &cl_device->fw_client->props.protocol_name))return -ENODEV ; client_data = devm_kzalloc(&cl_device->dev, sizeof(*client_data),
drivers/hid/intel-ish-hid/ishtp-hid.h +3 -3
@@ -29,9 +29,9 @@ client->cl_device->ishtp_dev, __VA_ARGS__)/* ISH Transport protocol (ISHTP in short) GUID */ -static const uuid_le hid_ishtp_guid =UUID_LE (0x33AECD58 ,0xB679 ,0x4E54 , -0x9B ,0xD9 ,0xA0 ,0x4D ,0x34 , -0xF0 ,0xC2 ,0x26 ); +static const guid_t hid_ishtp_guid = +GUID_INIT (0x33AECD58 ,0xB679 ,0x4E54 , +0x9B ,0xD9 ,0xA0 ,0x4D ,0x34 ,0xF0 ,0xC2 ,0x26 );/* ISH HID message structure */ struct hostif_msg_hdr {
drivers/hid/intel-ish-hid/ishtp/bus.c +8 -11
@@ -133,18 +133,15 @@ int ishtp_write_message(struct ishtp_device *dev, struct ishtp_msg_hdr *hdr,* * Return: fw client index or -ENOENT if not found */ -int ishtp_fw_cl_by_uuid (struct ishtp_device *dev,const uuid_le *uuid) +int ishtp_fw_cl_by_uuid (struct ishtp_device *dev,const guid_t *uuid) { -int i, res = -ENOENT ; +unsigned int i;for (i =0 ; i < dev->fw_clients_num; ++i) { -if (uuid_le_cmp (*uuid, dev->fw_clients[i].props.protocol_name) - ==0 ) { - res = i; -break ; - } +if (guid_equal (uuid, &dev->fw_clients[i].props.protocol_name)) +return i; } -return res; +return -ENOENT ; }EXPORT_SYMBOL (ishtp_fw_cl_by_uuid);
@@ -158,7 +155,7 @@ EXPORT_SYMBOL(ishtp_fw_cl_by_uuid);* Return: pointer of client information on success, NULL on failure. */ struct ishtp_fw_client *ishtp_fw_cl_get_client (struct ishtp_device *dev, -const uuid_le *uuid) +const guid_t *uuid) {int i;unsigned long flags;
@@ -401,7 +398,7 @@ static const struct device_type ishtp_cl_device_type = {* Return: ishtp_cl_device pointer or NULL on failure */ static struct ishtp_cl_device *ishtp_bus_add_device (struct ishtp_device *dev, -uuid_le uuid,char *name) +guid_t uuid,char *name) {struct ishtp_cl_device *device;int status;
@@ -629,7 +626,7 @@ int ishtp_bus_new_client(struct ishtp_device *dev)int i;char *dev_name;struct ishtp_cl_device *cl_device; -uuid_le device_uuid; +guid_t device_uuid;/* * For all reported clients, create an unconnected client and add its
drivers/hid/intel-ish-hid/ishtp/bus.h +2 -2
@@ -112,8 +112,8 @@ void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);int ishtp_register_event_cb (struct ishtp_cl_device *device,void (*read_cb)(struct ishtp_cl_device *)); -int ishtp_fw_cl_by_uuid (struct ishtp_device *dev,const uuid_le *cuuid); +int ishtp_fw_cl_by_uuid (struct ishtp_device *dev,const guid_t *cuuid);struct ishtp_fw_client *ishtp_fw_cl_get_client (struct ishtp_device *dev, -const uuid_le *uuid); +const guid_t *uuid);#endif /* _LINUX_ISHTP_CL_BUS_H */
drivers/hid/intel-ish-hid/ishtp/client.h +1 -1
@@ -126,7 +126,7 @@ struct ishtp_cl { };/* Client connection managenment internal functions */ -int ishtp_can_client_connect (struct ishtp_device *ishtp_dev,uuid_le *uuid); +int ishtp_can_client_connect (struct ishtp_device *ishtp_dev,guid_t *uuid);int ishtp_fw_cl_by_id (struct ishtp_device *dev,uint8_t client_id);void ishtp_cl_send_msg (struct ishtp_device *dev,struct ishtp_cl *cl); void recv_ishtp_cl_msg(struct ishtp_device *dev,
drivers/hid/intel-ish-hid/ishtp/hbm.h +1 -1
@@ -149,7 +149,7 @@ struct hbm_host_enum_response { } __packed;struct ishtp_client_properties { -uuid_le protocol_name; +guid_t protocol_name;uint8_t protocol_version;uint8_t max_number_of_connections;uint8_t fixed_address;
Signature · 1 line
2.20.1
Quoted 20 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/hid/intel-ish-hid/ishtp-hid-client.c | 3 +-- drivers/hid/intel-ish-hid/ishtp-hid.h | 6 +++--- drivers/hid/intel-ish-hid/ishtp/bus.c | 19 ++++++++----------- drivers/hid/intel-ish-hid/ishtp/bus.h | 4 ++-- drivers/hid/intel-ish-hid/ishtp/client.h | 2 +- drivers/hid/intel-ish-hid/ishtp/hbm.h | 2 +- 6 files changed, 16 insertions(+), 20 deletions(-)drivers/hid/intel-ish-hid/ishtp-hid-client.c +0
-0
drivers/hid/intel-ish-hid/ishtp-hid-client.c static int hid_ishtp_cl_probe(struct ishtp_cl_device *cl_device) · line 791
Quoted 6 lines
drivers/hid/intel-ish-hid/ishtp-hid-client.c +1
-2@@ -788,8 +788,7 @@ static int hid_ishtp_cl_probe(struct ishtp_cl_device *cl_device)if (!cl_device)return -ENODEV ; -if (uuid_le_cmp (hid_ishtp_guid, - cl_device->fw_client->props.protocol_name) !=0 ) +if (!guid_equal (&hid_ishtp_guid, &cl_device->fw_client->props.protocol_name))
This adds an overly long line.
With that fixed:
Quoted 7 lines · Andy Shevchenko
There are new types and helpers that are supposed to be used in new code.
As a preparation to get rid of legacy types and API functions do the conversion here.
Signed-off-by Andy Shevchenko <[email protected]>
Quoted 170 lines
--- drivers/hid/intel-ish-hid/ishtp-hid-client.c | 3 +-- drivers/hid/intel-ish-hid/ishtp-hid.h | 6 +++--- drivers/hid/intel-ish-hid/ishtp/bus.c | 19 ++++++++-------- --- drivers/hid/intel-ish-hid/ishtp/bus.h | 4 ++-- drivers/hid/intel-ish-hid/ishtp/client.h | 2 +- drivers/hid/intel-ish-hid/ishtp/hbm.h | 2 +- 6 files changed, 16 insertions(+), 20 deletions(-)drivers/hid/intel-ish-hid/ishtp-hid-client.c +1
-2@@ -788,8 +788,7 @@ static int hid_ishtp_cl_probe(struct ishtp_cl_device *cl_device)if (!cl_device)return -ENODEV ; -if (uuid_le_cmp (hid_ishtp_guid, - cl_device->fw_client->props.protocol_name) != 0) +if (!guid_equal (&hid_ishtp_guid, &cl_device->fw_client- >props.protocol_name))drivers/hid/intel-ish-hid/ishtp-hid-client.c +0
-0return -ENODEV ; client_data = devm_kzalloc(&cl_device->dev,
sizeof(*client_data),drivers/hid/intel-ish-hid/ishtp-hid.h +3
-3@@ -29,9 +29,9 @@ client->cl_device->ishtp_dev, __VA_ARGS__)/* ISH Transport protocol (ISHTP in short) GUID */ -static const uuid_le hid_ishtp_guid =UUID_LE (0x33AECD58 ,0xB679 ,0x4E54 , -0x9B ,0xD9 ,0xA0 ,0x4D ,0x34 , -0xF0 ,0xC2 ,0x26 ); +static const guid_t hid_ishtp_guid = +GUID_INIT (0x33AECD58 ,0xB679 ,0x4E54 , +0x9B ,0xD9 ,0xA0 ,0x4D ,0x34 ,0xF0 ,0xC2 ,0x26 );/* ISH HID message structure */
structhostif_msg_hdr{drivers/hid/intel-ish-hid/ishtp/bus.c +4
-7@@ -133,18 +133,15 @@ int ishtp_write_message(struct ishtp_device*dev, struct ishtp_msg_hdr *hdr, * * Return: fw client index or -ENOENT if not found */ -int ishtp_fw_cl_by_uuid (struct ishtp_device *dev,const uuid_le *uuid) +int ishtp_fw_cl_by_uuid (struct ishtp_device *dev,const guid_t *uuid) { -int i, res = -ENOENT ; +unsigned int i;for (i =0 ; i < dev->fw_clients_num; ++i) { -if (uuid_le_cmp (*uuid, dev- >fw_clients[i].props.protocol_name) - ==0 ) { - res = i; -break ; - } +if (guid_equal (uuid, &dev- >fw_clients[i].props.protocol_name)) +return i;drivers/hid/intel-ish-hid/ishtp/bus.c +1
-1} -return res; +return -ENOENT ; }EXPORT_SYMBOL (ishtp_fw_cl_by_uuid);@@ -158,7 +155,7 @@ EXPORT_SYMBOL(ishtp_fw_cl_by_uuid);* Return: pointer of client information on success, NULL on failure.
*/
structishtp_fw_client*ishtp_fw_cl_get_client(structishtp_device
*dev,drivers/hid/intel-ish-hid/ishtp/bus.c +2
-2- const uuid_le *uuid) + const guid_t *uuid) {int i;unsigned long flags;@@ -401,7 +398,7 @@ static const struct device_typeishtp_cl_device_type = { * Return: ishtp_cl_device pointer or NULL on failure */ static struct ishtp_cl_device *ishtp_bus_add_device (struct ishtp_device *dev, -uuid_le uuid,char *name) + guid_t uuid, char*name)
{drivers/hid/intel-ish-hid/ishtp/bus.c +1
-1struct ishtp_cl_device *device;int status;@@ -629,7 +626,7 @@ int ishtp_bus_new_client(struct ishtp_device *dev)int i;char *dev_name;struct ishtp_cl_device *cl_device; -uuid_le device_uuid; +guid_t device_uuid;/* * For all reported clients, create an unconnected client and
add itsdrivers/hid/intel-ish-hid/ishtp/bus.h +1
-1@@ -112,8 +112,8 @@ void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);int ishtp_register_event_cb (struct ishtp_cl_device *device,void (*read_cb)(struct ishtp_cl_device *)); -int ishtp_fw_cl_by_uuid (struct ishtp_device *dev,const uuid_le *cuuid); +int ishtp_fw_cl_by_uuid (struct ishtp_device *dev,const guid_t *cuuid);struct
ishtp_fw_client*ishtp_fw_cl_get_client(structishtp_device*dev,drivers/hid/intel-ish-hid/ishtp/bus.h +1
-1- const uuid_le *uuid); + const guid_t *uuid);#endif /* _LINUX_ISHTP_CL_BUS_H */ drivers/hid/intel-ish-hid/ishtp/client.h +1
-1@@ -126,7 +126,7 @@ struct ishtp_cl { };/* Client connection managenment internal functions */ -int ishtp_can_client_connect (struct ishtp_device *ishtp_dev,uuid_le *uuid); +int ishtp_can_client_connect (struct ishtp_device *ishtp_dev,guid_t *uuid);int ishtp_fw_cl_by_id (struct ishtp_device *dev,uint8_t client_id);void ishtp_cl_send_msg(struct
ishtp_device*dev, structishtp_cl
*cl);
void recv_ishtp_cl_msg(structishtp_device*dev,drivers/hid/intel-ish-hid/ishtp/hbm.h +1
-1@@ -149,7 +149,7 @@ struct hbm_host_enum_response { } __packed;struct ishtp_client_properties { -uuid_le protocol_name; +guid_t protocol_name;uint8_t protocol_version;uint8_t max_number_of_connections;uint8_t fixed_address;