Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: intel-ish-hid: Update ishtp bus match to support device ID table

The ishtp_cl_bus_match() function previously only checked the first entry
in the driver's device ID table. Update it to iterate over the entire
table, allowing proper matching for drivers with multiple supported
protocol GUIDs.

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>

authored by

Zhang Lixu and committed by
Benjamin Tissoires
daeed86b 0e13150c

+10 -2
+10 -2
drivers/hid/intel-ish-hid/ishtp/bus.c
··· 240 240 { 241 241 struct ishtp_cl_device *device = to_ishtp_cl_device(dev); 242 242 struct ishtp_cl_driver *driver = to_ishtp_cl_driver(drv); 243 + struct ishtp_fw_client *client = device->fw_client; 244 + const struct ishtp_device_id *id; 243 245 244 - return(device->fw_client ? guid_equal(&driver->id[0].guid, 245 - &device->fw_client->props.protocol_name) : 0); 246 + if (client) { 247 + for (id = driver->id; !guid_is_null(&id->guid); id++) { 248 + if (guid_equal(&id->guid, &client->props.protocol_name)) 249 + return 1; 250 + } 251 + } 252 + 253 + return 0; 246 254 } 247 255 248 256 /**