Skip to content

Commit d066f14

Browse files
mellanoxbmcdvhart
authored andcommitted
platform/x86: mlx-platform: Use define for the channel numbers
Add define for the channels number for mux device, instead of using hardcoded value inside the code in order to improve code readability. Signed-off-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
1 parent 502ab00 commit d066f14

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/platform/x86/mlx-platform.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@
8585
#define MLXPLAT_CPLD_FAN_MASK GENMASK(3, 0)
8686
#define MLXPLAT_CPLD_FAN_NG_MASK GENMASK(5, 0)
8787

88+
/* Number of channels in group */
89+
#define MLXPLAT_CPLD_GRP_CHNL_NUM 8
90+
8891
/* Start channel numbers */
8992
#define MLXPLAT_CPLD_CH1 2
9093
#define MLXPLAT_CPLD_CH2 10
@@ -124,7 +127,7 @@ static const struct resource mlxplat_lpc_resources[] = {
124127
};
125128

126129
/* Platform default channels */
127-
static const int mlxplat_default_channels[][8] = {
130+
static const int mlxplat_default_channels[][MLXPLAT_CPLD_GRP_CHNL_NUM] = {
128131
{
129132
MLXPLAT_CPLD_CH1, MLXPLAT_CPLD_CH1 + 1, MLXPLAT_CPLD_CH1 + 2,
130133
MLXPLAT_CPLD_CH1 + 3, MLXPLAT_CPLD_CH1 + 4, MLXPLAT_CPLD_CH1 +

0 commit comments

Comments
 (0)