net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO()
Subsystems (4)
PATCH 1/1 net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO()
The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read.
Signed-off-by Marek Vasut <[email protected]>
Cc Andrew Lunn <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Heiner Kallweit <[email protected]>
Cc Jean Delvare <[email protected]>
--- drivers/net/phy/nxp-tja11xx.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-)
drivers/net/phy/nxp-tja11xx.c +2 -22
@@ -311,29 +311,9 @@ static umode_t tja11xx_hwmon_is_visible(const void *data,return 0 ; } -static u32 tja11xx_hwmon_in_config[] = { -HWMON_I_LCRIT_ALARM , -0 -}; - -static const struct hwmon_channel_info tja11xx_hwmon_in = { - .type = hwmon_in, - .config = tja11xx_hwmon_in_config, -}; - -static u32 tja11xx_hwmon_temp_config[] = { -HWMON_T_CRIT_ALARM , -0 -}; - -static const struct hwmon_channel_info tja11xx_hwmon_temp = { - .type = hwmon_temp, - .config = tja11xx_hwmon_temp_config, -}; -static const struct hwmon_channel_info *tja11xx_hwmon_info[] = { - &tja11xx_hwmon_in, - &tja11xx_hwmon_temp, +HWMON_CHANNEL_INFO (in,HWMON_I_LCRIT_ALARM ), +HWMON_CHANNEL_INFO (temp,HWMON_T_CRIT_ALARM ),NULL };
Signature · 1 line
2.20.1
Quoted 7 lines · Marek Vasut
The
HWMON_CHANNEL_INFOmacro simplifies the code, reduces the likelihood of errors, and makes the code easier to read.Signed-off-by Marek Vasut <[email protected]>Cc Andrew Lunn <[email protected]>Cc Florian Fainelli <[email protected]>Cc Guenter Roeck <[email protected]>
Reviewed-by Guenter Roeck <[email protected]>
Quoted 46 lines
--- drivers/net/phy/nxp-tja11xx.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-)drivers/net/phy/nxp-tja11xx.c +2
-22@@ -311,29 +311,9 @@ static umode_t tja11xx_hwmon_is_visible(const void *data,return 0 ; } -static u32 tja11xx_hwmon_in_config[] = { -HWMON_I_LCRIT_ALARM , -0 -}; - -static const struct hwmon_channel_info tja11xx_hwmon_in = { - .type = hwmon_in, - .config = tja11xx_hwmon_in_config, -}; - -static u32 tja11xx_hwmon_temp_config[] = { -HWMON_T_CRIT_ALARM , -0 -}; - -static const struct hwmon_channel_info tja11xx_hwmon_temp = { - .type = hwmon_temp, - .config = tja11xx_hwmon_temp_config, -}; -static const struct hwmon_channel_info *tja11xx_hwmon_info[] = { - &tja11xx_hwmon_in, - &tja11xx_hwmon_temp, +HWMON_CHANNEL_INFO (in,HWMON_I_LCRIT_ALARM ), +HWMON_CHANNEL_INFO (temp,HWMON_T_CRIT_ALARM ),NULL };Signature · 1 line
2.20.1
From: Marek Vasut <[email protected]>
Date: Tue, 28 May 2019 20:15:41 +0200
Quoted 4 lines
The
HWMON_CHANNEL_INFOmacro simplifies the code, reduces the likelihood of errors, and makes the code easier to read.Signed-off-by Marek Vasut <[email protected]>
Applied to net-next.