Skip to content

Commit 152d00a

Browse files
hkallweitkuba-moo
authored andcommitted
r8169: simplify setting hwmon attribute visibility
Use new member visible to simplify setting the static visibility. Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ac98b31 commit 152d00a

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5332,13 +5332,6 @@ static bool rtl_aspm_is_safe(struct rtl8169_private *tp)
53325332
return false;
53335333
}
53345334

5335-
static umode_t r8169_hwmon_is_visible(const void *drvdata,
5336-
enum hwmon_sensor_types type,
5337-
u32 attr, int channel)
5338-
{
5339-
return 0444;
5340-
}
5341-
53425335
static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
53435336
u32 attr, int channel, long *val)
53445337
{
@@ -5355,7 +5348,7 @@ static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
53555348
}
53565349

53575350
static const struct hwmon_ops r8169_hwmon_ops = {
5358-
.is_visible = r8169_hwmon_is_visible,
5351+
.visible = 0444,
53595352
.read = r8169_hwmon_read,
53605353
};
53615354

0 commit comments

Comments
 (0)