[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190528194850.GF24853@roeck-us.net>
Date: Tue, 28 May 2019 12:48:50 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Marek Vasut <marex@...x.de>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org
Subject: Re: [PATCH] net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO()
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@...x.de>
> Cc: Andrew Lunn <andrew@...n.ch>
> Cc: Florian Fainelli <f.fainelli@...il.com>
> Cc: Guenter Roeck <linux@...ck-us.net>
Reviewed-by: Guenter Roeck <linux@...ck-us.net>
> Cc: Heiner Kallweit <hkallweit1@...il.com>
> Cc: Jean Delvare <jdelvare@...e.com>
> Cc: linux-hwmon@...r.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
>
Powered by blists - more mailing lists