]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwmon: (sl28cpld) Simplify specifying static visibility attribute
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 11 Oct 2024 19:58:09 +0000 (21:58 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 10 Nov 2024 22:48:06 +0000 (14:48 -0800)
Use new member visible of struct hwmon_ops to simplify specifying
the static attribute visibility.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Message-ID: <5c26d8cf-d6dc-46c5-be7c-fd8207b3f177@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/sl28cpld-hwmon.c

index e020f25c930050ca363351736abc29329a3bcb81..454cc844fb9d35a72162e80d797ee5e69a70ff27 100644 (file)
@@ -23,13 +23,6 @@ struct sl28cpld_hwmon {
        u32 offset;
 };
 
-static umode_t sl28cpld_hwmon_is_visible(const void *data,
-                                        enum hwmon_sensor_types type,
-                                        u32 attr, int channel)
-{
-       return 0444;
-}
-
 static int sl28cpld_hwmon_read(struct device *dev,
                               enum hwmon_sensor_types type, u32 attr,
                               int channel, long *input)
@@ -73,7 +66,7 @@ static const struct hwmon_channel_info * const sl28cpld_hwmon_info[] = {
 };
 
 static const struct hwmon_ops sl28cpld_hwmon_ops = {
-       .is_visible = sl28cpld_hwmon_is_visible,
+       .visible = 0444,
        .read = sl28cpld_hwmon_read,
 };