]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwmon: (surface_fan) Simplify specifying static visibility attribute
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 11 Oct 2024 19:56:52 +0000 (21:56 +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: <d5d2570c-dfd9-4be5-ad9f-e721be477131@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/surface_fan.c

index de3c5a2409c618a6c24c1b277ef3988a7f8f38d6..aafb4ac92e6c6f7de2c8c4e49355d80a86cd0e25 100644 (file)
@@ -18,14 +18,6 @@ SSAM_DEFINE_SYNC_REQUEST_CL_R(__ssam_fan_rpm_get, __le16, {
        .command_id      = 0x01,
 });
 
-// hwmon
-static umode_t surface_fan_hwmon_is_visible(const void *drvdata,
-                                           enum hwmon_sensor_types type, u32 attr,
-                                           int channel)
-{
-       return 0444;
-}
-
 static int surface_fan_hwmon_read(struct device *dev,
                                  enum hwmon_sensor_types type, u32 attr,
                                  int channel, long *val)
@@ -49,7 +41,7 @@ static const struct hwmon_channel_info *const surface_fan_info[] = {
 };
 
 static const struct hwmon_ops surface_fan_hwmon_ops = {
-       .is_visible = surface_fan_hwmon_is_visible,
+       .visible = 0444,
        .read = surface_fan_hwmon_read,
 };