Skip to content

Commit 4798f48

Browse files
LiHuiSong1kuba-moo
authored andcommitted
net: phy: marvell10g: Use HWMON_CHANNEL_INFO macro to simplify code
Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li <lihuisong@huawei.com> Link: https://patch.msgid.link/20250210054710.12855-5-lihuisong@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0cb595e commit 4798f48

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

drivers/net/phy/marvell10g.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -230,29 +230,9 @@ static const struct hwmon_ops mv3310_hwmon_ops = {
230230
.read = mv3310_hwmon_read,
231231
};
232232

233-
static u32 mv3310_hwmon_chip_config[] = {
234-
HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL,
235-
0,
236-
};
237-
238-
static const struct hwmon_channel_info mv3310_hwmon_chip = {
239-
.type = hwmon_chip,
240-
.config = mv3310_hwmon_chip_config,
241-
};
242-
243-
static u32 mv3310_hwmon_temp_config[] = {
244-
HWMON_T_INPUT,
245-
0,
246-
};
247-
248-
static const struct hwmon_channel_info mv3310_hwmon_temp = {
249-
.type = hwmon_temp,
250-
.config = mv3310_hwmon_temp_config,
251-
};
252-
253233
static const struct hwmon_channel_info * const mv3310_hwmon_info[] = {
254-
&mv3310_hwmon_chip,
255-
&mv3310_hwmon_temp,
234+
HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL),
235+
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
256236
NULL,
257237
};
258238

0 commit comments

Comments
 (0)