r8169: simplify setting hwmon attribute visibility
Heiner Kallweit
maintainerPATCH 1/1 r8169: simplify setting hwmon attribute visibility
Use new member visible to simplify setting the static visibility.
Signed-off-by Heiner Kallweit <[email protected]>
--- drivers/net/ethernet/realtek/r8169_main.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/net/ethernet/realtek/r8169_main.c +1 -8
@@ -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) {
@@ -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, };
Signature · 1 line
2.47.1
Quoted 26 lines · Heiner Kallweit
Use new member visible to simplify setting the static visibility.
Signed-off-by Heiner Kallweit <[email protected]>--- drivers/net/ethernet/realtek/r8169_main.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)drivers/net/ethernet/realtek/r8169_main.c +0
-7@@ -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) {
drivers/net/ethernet/realtek/r8169_main.c static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type, · line 5353
Quoted 7 lines
drivers/net/ethernet/realtek/r8169_main.c +1
-1@@ -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, };
Nice simplification, thanks. I checked that it is the only driver under ethernet that use fixed value in is_visible().
Reviewed-by Michal Swiatkowski <[email protected]>
Quoted 3 lines
Signature · 2 lines
-- 2.47.1
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Tue, 3 Dec 2024 22:33:22 +0100 you wrote:
Use new member visible to simplify setting the static visibility.
Signed-off-by Heiner Kallweit <[email protected]>--- drivers/net/ethernet/realtek/r8169_main.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
Here is the summary with links:
- [net-next] r8169: simplify setting hwmon attribute visibility
https://git.kernel.org/netdev/net-next/c/152d00a91396
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html