]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: intel-ish-hid: Update ishtp bus match to support device ID table
authorZhang Lixu <lixu.zhang@intel.com>
Wed, 10 Dec 2025 02:53:28 +0000 (10:53 +0800)
committerBenjamin Tissoires <bentiss@kernel.org>
Fri, 19 Dec 2025 11:10:53 +0000 (12:10 +0100)
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>
drivers/hid/intel-ish-hid/ishtp/bus.c

index c6ce37244e49758ed271d976bba3af13fbb0aadd..c3915f3a060ead1652e91b23944cece56abe0aa6 100644 (file)
@@ -240,9 +240,17 @@ static int ishtp_cl_bus_match(struct device *dev, const struct device_driver *dr
 {
        struct ishtp_cl_device *device = to_ishtp_cl_device(dev);
        struct ishtp_cl_driver *driver = to_ishtp_cl_driver(drv);
+       struct ishtp_fw_client *client = device->fw_client;
+       const struct ishtp_device_id *id;
 
-       return(device->fw_client ? guid_equal(&driver->id[0].guid,
-              &device->fw_client->props.protocol_name) : 0);
+       if (client) {
+               for (id = driver->id; !guid_is_null(&id->guid); id++) {
+                       if (guid_equal(&id->guid, &client->props.protocol_name))
+                               return 1;
+               }
+       }
+
+       return 0;
 }
 
 /**