]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwmon: (powerz) Simplify specifying static visibility attribute
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 11 Oct 2024 20:00:49 +0000 (22:00 +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>
Acked-by: Thomas Weißschuh <linux@weissschuh.net>
Message-ID: <c4b4568b-59f6-43ac-8281-536a82ecd6ab@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/powerz.c

index cfb635f94d6654da0052e235df0a2a49473f1982..4e663d5b4e330b540b1bead34fa5bf57c607e244 100644 (file)
@@ -54,12 +54,6 @@ static const struct hwmon_channel_info *const powerz_info[] = {
        NULL
 };
 
-static umode_t powerz_is_visible(const void *data, enum hwmon_sensor_types type,
-                                u32 attr, int channel)
-{
-       return 0444;
-}
-
 static int powerz_read_string(struct device *dev, enum hwmon_sensor_types type,
                              u32 attr, int channel, const char **str)
 {
@@ -201,7 +195,7 @@ out:
 }
 
 static const struct hwmon_ops powerz_hwmon_ops = {
-       .is_visible = powerz_is_visible,
+       .visible = 0444,
        .read = powerz_read,
        .read_string = powerz_read_string,
 };