Skip to content

Commit 0cb595e

Browse files
LiHuiSong1kuba-moo
authored andcommitted
net: phy: marvell: 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-4-lihuisong@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e05427c commit 0cb595e

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

drivers/net/phy/marvell.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3124,33 +3124,13 @@ static umode_t marvell_hwmon_is_visible(const void *data,
31243124
}
31253125
}
31263126

3127-
static u32 marvell_hwmon_chip_config[] = {
3128-
HWMON_C_REGISTER_TZ,
3129-
0
3130-
};
3131-
3132-
static const struct hwmon_channel_info marvell_hwmon_chip = {
3133-
.type = hwmon_chip,
3134-
.config = marvell_hwmon_chip_config,
3135-
};
3136-
31373127
/* we can define HWMON_T_CRIT and HWMON_T_MAX_ALARM even though these are not
31383128
* defined for all PHYs, because the hwmon code checks whether the attributes
31393129
* exists via the .is_visible method
31403130
*/
3141-
static u32 marvell_hwmon_temp_config[] = {
3142-
HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_MAX_ALARM,
3143-
0
3144-
};
3145-
3146-
static const struct hwmon_channel_info marvell_hwmon_temp = {
3147-
.type = hwmon_temp,
3148-
.config = marvell_hwmon_temp_config,
3149-
};
3150-
31513131
static const struct hwmon_channel_info * const marvell_hwmon_info[] = {
3152-
&marvell_hwmon_chip,
3153-
&marvell_hwmon_temp,
3132+
HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
3133+
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_MAX_ALARM),
31543134
NULL
31553135
};
31563136

0 commit comments

Comments
 (0)