From: Marek Vasut <marex@denx.de>
To: netdev@vger.kernel.org
Cc: Marek Vasut <marex@denx.de>, Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Guenter Roeck <linux@roeck-us.net>,
Heiner Kallweit <hkallweit1@gmail.com>,
Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org
Subject: [PATCH] net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO()
Date: Tue, 28 May 2019 20:15:41 +0200 [thread overview]
Message-ID: <20190528181541.1946-1-marex@denx.de> (raw)
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
next reply other threads:[~2019-05-28 18:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-28 18:15 Marek Vasut [this message]
2019-05-28 19:48 ` [PATCH] net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO() Guenter Roeck
2019-05-30 5:03 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190528181541.1946-1-marex@denx.de \
--to=marex@denx.de \
--cc=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).