Skip to content

Commit

Permalink
r8169: simplify setting hwmon attribute visibility
Browse files Browse the repository at this point in the history
Use new member visible to simplify setting the static visibility.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Link: https://patch.msgid.link/dba77e76-be45-4a30-96c7-45e284072ad2@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Heiner Kallweit authored and Jakub Kicinski committed Dec 5, 2024
1 parent ac98b31 commit 152d00a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/net/ethernet/realtek/r8169_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5332,13 +5332,6 @@ static bool rtl_aspm_is_safe(struct rtl8169_private *tp)
return false;
}

static umode_t r8169_hwmon_is_visible(const void *drvdata,
enum hwmon_sensor_types type,
u32 attr, int channel)
{
return 0444;
}

static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{
Expand All @@ -5355,7 +5348,7 @@ static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
}

static const struct hwmon_ops r8169_hwmon_ops = {
.is_visible = r8169_hwmon_is_visible,
.visible = 0444,
.read = r8169_hwmon_read,
};

Expand Down

0 comments on commit 152d00a

Please sign in to comment.