HID: intel-ish-hid: Update ishtp bus match to support device ID table
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- drivers/hid/intel-ish-hid/ishtp/bus.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/hid/intel-ish-hid/ishtp/bus.c +10 -2
@@ -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 ; }/**
base-commit: c75caf76ed86bbc15a72808f48f8df1608a0886c
Signature · 1 line
2.43.0
Quoted 6 lines · Zhang Lixu
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.
Applied to hid/hid.git (for-6.19/upstream-fixes), thanks!
[1/1] HID: intel-ish-hid: Update ishtp bus match to support device ID table
https://git.kernel.org/hid/hid/c/daeed86b6868
Cheers,
Signature · 1 line
Benjamin Tissoires <[email protected]>