]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
HID: hid-belkin: clean up usage of 'driver_data'
authorPawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk>
Mon, 18 May 2026 16:06:24 +0000 (17:06 +0100)
committerBenjamin Tissoires <bentiss@kernel.org>
Mon, 1 Jun 2026 16:28:41 +0000 (18:28 +0200)
commit4de4b8a5ddc2c5a2e0f62c72864caab7027ea67a
tree15bb85179491558ea6d5e1268dce0dbac2ffc7c8
parente6f4f084ecd876a333c4cf13d0229217dbfcd8e8
HID: hid-belkin: clean up usage of 'driver_data'

The module is storing an integer inside the drvdata pointer, which is
confusing, lets fix this and set the whole of 'hid_device_id' struct
as the drvdata and then simply use its integer 'driver_data' field for
quirks, which shall make the code cleaner, type-safe, consistent and
more readable.

This makes the cast to (void *) during storage a bit safer (just to
suppress the const qualifier warning) and the cast to (unsigned long)
during retrieval is removed.

Signed-off-by: Pawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/hid-belkin.c