Skip to content

Commit 1410650

Browse files
andy-shevJiri Kosina
authored andcommitted
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. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 2edefc0 commit 1410650

File tree

6 files changed

+18
-21
lines changed

6 files changed

+18
-21
lines changed

drivers/hid/intel-ish-hid/ishtp-hid-client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,8 @@ static int hid_ishtp_cl_probe(struct ishtp_cl_device *cl_device)
788788
if (!cl_device)
789789
return -ENODEV;
790790

791-
if (uuid_le_cmp(hid_ishtp_guid,
792-
cl_device->fw_client->props.protocol_name) != 0)
791+
if (!guid_equal(&hid_ishtp_guid,
792+
&cl_device->fw_client->props.protocol_name))
793793
return -ENODEV;
794794

795795
client_data = devm_kzalloc(&cl_device->dev, sizeof(*client_data),

drivers/hid/intel-ish-hid/ishtp-hid.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
client->cl_device->ishtp_dev, __VA_ARGS__)
3030

3131
/* ISH Transport protocol (ISHTP in short) GUID */
32-
static const uuid_le hid_ishtp_guid = UUID_LE(0x33AECD58, 0xB679, 0x4E54,
33-
0x9B, 0xD9, 0xA0, 0x4D, 0x34,
34-
0xF0, 0xC2, 0x26);
32+
static const guid_t hid_ishtp_guid =
33+
GUID_INIT(0x33AECD58, 0xB679, 0x4E54,
34+
0x9B, 0xD9, 0xA0, 0x4D, 0x34, 0xF0, 0xC2, 0x26);
3535

3636
/* ISH HID message structure */
3737
struct hostif_msg_hdr {

drivers/hid/intel-ish-hid/ishtp/bus.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,15 @@ int ishtp_write_message(struct ishtp_device *dev, struct ishtp_msg_hdr *hdr,
133133
*
134134
* Return: fw client index or -ENOENT if not found
135135
*/
136-
int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const uuid_le *uuid)
136+
int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const guid_t *uuid)
137137
{
138-
int i, res = -ENOENT;
138+
unsigned int i;
139139

140140
for (i = 0; i < dev->fw_clients_num; ++i) {
141-
if (uuid_le_cmp(*uuid, dev->fw_clients[i].props.protocol_name)
142-
== 0) {
143-
res = i;
144-
break;
145-
}
141+
if (guid_equal(uuid, &dev->fw_clients[i].props.protocol_name))
142+
return i;
146143
}
147-
return res;
144+
return -ENOENT;
148145
}
149146
EXPORT_SYMBOL(ishtp_fw_cl_by_uuid);
150147

@@ -158,7 +155,7 @@ EXPORT_SYMBOL(ishtp_fw_cl_by_uuid);
158155
* Return: pointer of client information on success, NULL on failure.
159156
*/
160157
struct ishtp_fw_client *ishtp_fw_cl_get_client(struct ishtp_device *dev,
161-
const uuid_le *uuid)
158+
const guid_t *uuid)
162159
{
163160
int i;
164161
unsigned long flags;
@@ -401,7 +398,7 @@ static const struct device_type ishtp_cl_device_type = {
401398
* Return: ishtp_cl_device pointer or NULL on failure
402399
*/
403400
static struct ishtp_cl_device *ishtp_bus_add_device(struct ishtp_device *dev,
404-
uuid_le uuid, char *name)
401+
guid_t uuid, char *name)
405402
{
406403
struct ishtp_cl_device *device;
407404
int status;
@@ -629,7 +626,7 @@ int ishtp_bus_new_client(struct ishtp_device *dev)
629626
int i;
630627
char *dev_name;
631628
struct ishtp_cl_device *cl_device;
632-
uuid_le device_uuid;
629+
guid_t device_uuid;
633630

634631
/*
635632
* For all reported clients, create an unconnected client and add its
@@ -639,7 +636,7 @@ int ishtp_bus_new_client(struct ishtp_device *dev)
639636
*/
640637
i = dev->fw_client_presentation_num - 1;
641638
device_uuid = dev->fw_clients[i].props.protocol_name;
642-
dev_name = kasprintf(GFP_KERNEL, "{%pUL}", device_uuid.b);
639+
dev_name = kasprintf(GFP_KERNEL, "{%pUL}", &device_uuid);
643640
if (!dev_name)
644641
return -ENOMEM;
645642

drivers/hid/intel-ish-hid/ishtp/bus.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);
112112

113113
int ishtp_register_event_cb(struct ishtp_cl_device *device,
114114
void (*read_cb)(struct ishtp_cl_device *));
115-
int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const uuid_le *cuuid);
115+
int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const guid_t *cuuid);
116116
struct ishtp_fw_client *ishtp_fw_cl_get_client(struct ishtp_device *dev,
117-
const uuid_le *uuid);
117+
const guid_t *uuid);
118118

119119
#endif /* _LINUX_ISHTP_CL_BUS_H */

drivers/hid/intel-ish-hid/ishtp/client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct ishtp_cl {
126126
};
127127

128128
/* Client connection managenment internal functions */
129-
int ishtp_can_client_connect(struct ishtp_device *ishtp_dev, uuid_le *uuid);
129+
int ishtp_can_client_connect(struct ishtp_device *ishtp_dev, guid_t *uuid);
130130
int ishtp_fw_cl_by_id(struct ishtp_device *dev, uint8_t client_id);
131131
void ishtp_cl_send_msg(struct ishtp_device *dev, struct ishtp_cl *cl);
132132
void recv_ishtp_cl_msg(struct ishtp_device *dev,

drivers/hid/intel-ish-hid/ishtp/hbm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ struct hbm_host_enum_response {
149149
} __packed;
150150

151151
struct ishtp_client_properties {
152-
uuid_le protocol_name;
152+
guid_t protocol_name;
153153
uint8_t protocol_version;
154154
uint8_t max_number_of_connections;
155155
uint8_t fixed_address;

0 commit comments

Comments
 (0)