linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO()
@ 2019-05-28 18:15 Marek Vasut
  2019-05-28 19:48 ` Guenter Roeck
  2019-05-30  5:03 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Marek Vasut @ 2019-05-28 18:15 UTC (permalink / raw)
  To: netdev
  Cc: Marek Vasut, Andrew Lunn, Florian Fainelli, Guenter Roeck,
	Heiner Kallweit, Jean Delvare, linux-hwmon

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 <marex@denx.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org
---
 drivers/net/phy/nxp-tja11xx.c | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/drivers/net/phy/nxp-tja11xx.c b/drivers/net/phy/nxp-tja11xx.c
index 11b8701e78fd..b705d0bd798b 100644
--- a/drivers/net/phy/nxp-tja11xx.c
+++ b/drivers/net/phy/nxp-tja11xx.c
@@ -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
 };
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO()
  2019-05-28 18:15 [PATCH] net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO() Marek Vasut
@ 2019-05-28 19:48 ` Guenter Roeck
  2019-05-30  5:03 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2019-05-28 19:48 UTC (permalink / raw)
  To: Marek Vasut
  Cc: netdev, Andrew Lunn, Florian Fainelli, Heiner Kallweit,
	Jean Delvare, linux-hwmon

On Tue, May 28, 2019 at 08:15:41PM +0200, Marek Vasut wrote:
> 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 <marex@denx.de>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Guenter Roeck <linux@roeck-us.net>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> Cc: Heiner Kallweit <hkallweit1@gmail.com>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: linux-hwmon@vger.kernel.org
> ---
>  drivers/net/phy/nxp-tja11xx.c | 24 ++----------------------
>  1 file changed, 2 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/net/phy/nxp-tja11xx.c b/drivers/net/phy/nxp-tja11xx.c
> index 11b8701e78fd..b705d0bd798b 100644
> --- a/drivers/net/phy/nxp-tja11xx.c
> +++ b/drivers/net/phy/nxp-tja11xx.c
> @@ -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
>  };
>  
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO()
  2019-05-28 18:15 [PATCH] net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO() Marek Vasut
  2019-05-28 19:48 ` Guenter Roeck
@ 2019-05-30  5:03 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-05-30  5:03 UTC (permalink / raw)
  To: marex
  Cc: netdev, andrew, f.fainelli, linux, hkallweit1, jdelvare, linux-hwmon

From: Marek Vasut <marex@denx.de>
Date: Tue, 28 May 2019 20:15:41 +0200

> 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 <marex@denx.de>

Applied to net-next.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-30  5:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-28 18:15 [PATCH] net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO() Marek Vasut
2019-05-28 19:48 ` Guenter Roeck
2019-05-30  5:03 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).