]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (max16065) Remove use of i2c_match_id()
authorAndrew Davis <afd@ti.com>
Wed, 3 Apr 2024 20:36:21 +0000 (15:36 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:10:50 +0000 (15:10 +0200)
commitd522354ca1c8bbc4bb9f947631553e6bf9a8aa22
tree8166c84f26907d16151aae8cb6213264196eddb3
parent41fe2205aae6625a2c0a5dcc8bde082bb4b1ac3c
hwmon: (max16065) Remove use of i2c_match_id()

[ Upstream commit 5a71654b398e3471f0169c266a3587cf09e1200c ]

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-20-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Stable-dep-of: 119abf7d1815 ("hwmon: (max16065) Fix alarm attributes")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/max16065.c