* [PATCH v1 1/9] media: video-i2c: Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
@ 2025-01-24 2:26 ` Huisong Li
2025-01-24 2:26 ` [PATCH v1 2/9] net: aquantia: " Huisong Li
` (9 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Huisong Li @ 2025-01-24 2:26 UTC (permalink / raw)
To: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong,
lihuisong
Use HWMON_CHANNEL_INFO macro to simplify code.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
drivers/media/i2c/video-i2c.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
index 036a6375627a..0dd991d70d53 100644
--- a/drivers/media/i2c/video-i2c.c
+++ b/drivers/media/i2c/video-i2c.c
@@ -264,18 +264,8 @@ static int amg88xx_set_power(struct video_i2c_data *data, bool on)
#if IS_REACHABLE(CONFIG_HWMON)
-static const u32 amg88xx_temp_config[] = {
- HWMON_T_INPUT,
- 0
-};
-
-static const struct hwmon_channel_info amg88xx_temp = {
- .type = hwmon_temp,
- .config = amg88xx_temp_config,
-};
-
static const struct hwmon_channel_info * const amg88xx_info[] = {
- &amg88xx_temp,
+ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
NULL
};
--
2.22.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v1 2/9] net: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
2025-01-24 2:26 ` [PATCH v1 1/9] media: video-i2c: " Huisong Li
@ 2025-01-24 2:26 ` Huisong Li
2025-01-24 2:26 ` [PATCH v1 3/9] net: nfp: " Huisong Li
` (8 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Huisong Li @ 2025-01-24 2:26 UTC (permalink / raw)
To: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong,
lihuisong
Use HWMON_CHANNEL_INFO macro to simplify code.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
.../net/ethernet/aquantia/atlantic/aq_drvinfo.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c
index 414b2e448d59..787ea91802e7 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c
@@ -113,19 +113,9 @@ static const struct hwmon_ops aq_hwmon_ops = {
.read_string = aq_hwmon_read_string,
};
-static u32 aq_hwmon_temp_config[] = {
- HWMON_T_INPUT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_LABEL,
- 0,
-};
-
-static const struct hwmon_channel_info aq_hwmon_temp = {
- .type = hwmon_temp,
- .config = aq_hwmon_temp_config,
-};
-
static const struct hwmon_channel_info * const aq_hwmon_info[] = {
- &aq_hwmon_temp,
+ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_LABEL,
+ HWMON_T_INPUT | HWMON_T_LABEL),
NULL,
};
--
2.22.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v1 3/9] net: nfp: Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
2025-01-24 2:26 ` [PATCH v1 1/9] media: video-i2c: " Huisong Li
2025-01-24 2:26 ` [PATCH v1 2/9] net: aquantia: " Huisong Li
@ 2025-01-24 2:26 ` Huisong Li
2025-01-24 2:26 ` [PATCH v1 4/9] net: phy: marvell: " Huisong Li
` (7 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Huisong Li @ 2025-01-24 2:26 UTC (permalink / raw)
To: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong,
lihuisong
Use HWMON_CHANNEL_INFO macro to simplify code.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
.../net/ethernet/netronome/nfp/nfp_hwmon.c | 40 +++----------------
1 file changed, 5 insertions(+), 35 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c
index 0d6c59d6d4ae..ea6a288c0d5e 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c
@@ -83,42 +83,12 @@ nfp_hwmon_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr,
return 0;
}
-static u32 nfp_chip_config[] = {
- HWMON_C_REGISTER_TZ,
- 0
-};
-
-static const struct hwmon_channel_info nfp_chip = {
- .type = hwmon_chip,
- .config = nfp_chip_config,
-};
-
-static u32 nfp_temp_config[] = {
- HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_CRIT,
- 0
-};
-
-static const struct hwmon_channel_info nfp_temp = {
- .type = hwmon_temp,
- .config = nfp_temp_config,
-};
-
-static u32 nfp_power_config[] = {
- HWMON_P_INPUT | HWMON_P_MAX,
- HWMON_P_INPUT,
- HWMON_P_INPUT,
- 0
-};
-
-static const struct hwmon_channel_info nfp_power = {
- .type = hwmon_power,
- .config = nfp_power_config,
-};
-
static const struct hwmon_channel_info * const nfp_hwmon_info[] = {
- &nfp_chip,
- &nfp_temp,
- &nfp_power,
+ HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
+ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_CRIT),
+ HWMON_CHANNEL_INFO(power, HWMON_P_INPUT | HWMON_P_MAX,
+ HWMON_P_INPUT,
+ HWMON_P_INPUT),
NULL
};
--
2.22.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v1 4/9] net: phy: marvell: Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
` (2 preceding siblings ...)
2025-01-24 2:26 ` [PATCH v1 3/9] net: nfp: " Huisong Li
@ 2025-01-24 2:26 ` Huisong Li
2025-01-24 2:26 ` [PATCH v1 5/9] net: phy: marvell10g: " Huisong Li
` (6 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Huisong Li @ 2025-01-24 2:26 UTC (permalink / raw)
To: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong,
lihuisong
Use HWMON_CHANNEL_INFO macro to simplify code.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
drivers/net/phy/marvell.c | 24 ++----------------------
1 file changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 44e1927de499..dd254e36ca8a 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -3124,33 +3124,13 @@ static umode_t marvell_hwmon_is_visible(const void *data,
}
}
-static u32 marvell_hwmon_chip_config[] = {
- HWMON_C_REGISTER_TZ,
- 0
-};
-
-static const struct hwmon_channel_info marvell_hwmon_chip = {
- .type = hwmon_chip,
- .config = marvell_hwmon_chip_config,
-};
-
/* we can define HWMON_T_CRIT and HWMON_T_MAX_ALARM even though these are not
* defined for all PHYs, because the hwmon code checks whether the attributes
* exists via the .is_visible method
*/
-static u32 marvell_hwmon_temp_config[] = {
- HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_MAX_ALARM,
- 0
-};
-
-static const struct hwmon_channel_info marvell_hwmon_temp = {
- .type = hwmon_temp,
- .config = marvell_hwmon_temp_config,
-};
-
static const struct hwmon_channel_info * const marvell_hwmon_info[] = {
- &marvell_hwmon_chip,
- &marvell_hwmon_temp,
+ HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
+ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_MAX_ALARM),
NULL
};
--
2.22.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v1 5/9] net: phy: marvell10g: Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
` (3 preceding siblings ...)
2025-01-24 2:26 ` [PATCH v1 4/9] net: phy: marvell: " Huisong Li
@ 2025-01-24 2:26 ` Huisong Li
2025-01-24 2:26 ` [PATCH v1 6/9] rtc: ab-eoz9: " Huisong Li
` (5 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Huisong Li @ 2025-01-24 2:26 UTC (permalink / raw)
To: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong,
lihuisong
Use HWMON_CHANNEL_INFO macro to simplify code.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
drivers/net/phy/marvell10g.c | 24 ++----------------------
1 file changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 623bdb8466b8..5354c8895163 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -230,29 +230,9 @@ static const struct hwmon_ops mv3310_hwmon_ops = {
.read = mv3310_hwmon_read,
};
-static u32 mv3310_hwmon_chip_config[] = {
- HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL,
- 0,
-};
-
-static const struct hwmon_channel_info mv3310_hwmon_chip = {
- .type = hwmon_chip,
- .config = mv3310_hwmon_chip_config,
-};
-
-static u32 mv3310_hwmon_temp_config[] = {
- HWMON_T_INPUT,
- 0,
-};
-
-static const struct hwmon_channel_info mv3310_hwmon_temp = {
- .type = hwmon_temp,
- .config = mv3310_hwmon_temp_config,
-};
-
static const struct hwmon_channel_info * const mv3310_hwmon_info[] = {
- &mv3310_hwmon_chip,
- &mv3310_hwmon_temp,
+ HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL),
+ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
NULL,
};
--
2.22.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v1 6/9] rtc: ab-eoz9: Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
` (4 preceding siblings ...)
2025-01-24 2:26 ` [PATCH v1 5/9] net: phy: marvell10g: " Huisong Li
@ 2025-01-24 2:26 ` Huisong Li
2025-01-24 2:26 ` [PATCH v1 7/9] rtc: ds3232: " Huisong Li
` (4 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Huisong Li @ 2025-01-24 2:26 UTC (permalink / raw)
To: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong,
lihuisong
Use HWMON_CHANNEL_INFO macro to simplify code.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
drivers/rtc/rtc-ab-eoz9.c | 24 ++----------------------
1 file changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/rtc/rtc-ab-eoz9.c b/drivers/rtc/rtc-ab-eoz9.c
index d2b60487d462..de002f7a39bf 100644
--- a/drivers/rtc/rtc-ab-eoz9.c
+++ b/drivers/rtc/rtc-ab-eoz9.c
@@ -426,29 +426,9 @@ static umode_t abeoz9_is_visible(const void *data,
}
}
-static const u32 abeoz9_chip_config[] = {
- HWMON_C_REGISTER_TZ,
- 0
-};
-
-static const struct hwmon_channel_info abeoz9_chip = {
- .type = hwmon_chip,
- .config = abeoz9_chip_config,
-};
-
-static const u32 abeoz9_temp_config[] = {
- HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN,
- 0
-};
-
-static const struct hwmon_channel_info abeoz9_temp = {
- .type = hwmon_temp,
- .config = abeoz9_temp_config,
-};
-
static const struct hwmon_channel_info * const abeoz9_info[] = {
- &abeoz9_chip,
- &abeoz9_temp,
+ HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
+ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN),
NULL
};
--
2.22.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v1 7/9] rtc: ds3232: Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
` (5 preceding siblings ...)
2025-01-24 2:26 ` [PATCH v1 6/9] rtc: ab-eoz9: " Huisong Li
@ 2025-01-24 2:26 ` Huisong Li
2025-01-24 2:26 ` [PATCH v1 8/9] w1: w1_therm: w1: " Huisong Li
` (3 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Huisong Li @ 2025-01-24 2:26 UTC (permalink / raw)
To: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong,
lihuisong
Use HWMON_CHANNEL_INFO macro to simplify code.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
drivers/rtc/rtc-ds3232.c | 24 ++----------------------
1 file changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c
index 19c09c418746..18f35823b4b5 100644
--- a/drivers/rtc/rtc-ds3232.c
+++ b/drivers/rtc/rtc-ds3232.c
@@ -339,29 +339,9 @@ static int ds3232_hwmon_read(struct device *dev,
return err;
}
-static u32 ds3232_hwmon_chip_config[] = {
- HWMON_C_REGISTER_TZ,
- 0
-};
-
-static const struct hwmon_channel_info ds3232_hwmon_chip = {
- .type = hwmon_chip,
- .config = ds3232_hwmon_chip_config,
-};
-
-static u32 ds3232_hwmon_temp_config[] = {
- HWMON_T_INPUT,
- 0
-};
-
-static const struct hwmon_channel_info ds3232_hwmon_temp = {
- .type = hwmon_temp,
- .config = ds3232_hwmon_temp_config,
-};
-
static const struct hwmon_channel_info * const ds3232_hwmon_info[] = {
- &ds3232_hwmon_chip,
- &ds3232_hwmon_temp,
+ HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
+ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
NULL
};
--
2.22.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v1 8/9] w1: w1_therm: w1: Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
` (6 preceding siblings ...)
2025-01-24 2:26 ` [PATCH v1 7/9] rtc: ds3232: " Huisong Li
@ 2025-01-24 2:26 ` Huisong Li
2025-02-03 11:56 ` (subset) " Krzysztof Kozlowski
2025-01-24 2:26 ` [PATCH v1 9/9] net: phy: aquantia: " Huisong Li
` (2 subsequent siblings)
10 siblings, 1 reply; 18+ messages in thread
From: Huisong Li @ 2025-01-24 2:26 UTC (permalink / raw)
To: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong,
lihuisong
Use HWMON_CHANNEL_INFO macro to simplify code.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
drivers/w1/slaves/w1_therm.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index c85e80c7e130..9ccedb3264fb 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -444,18 +444,8 @@ static int w1_read(struct device *dev, enum hwmon_sensor_types type,
}
}
-static const u32 w1_temp_config[] = {
- HWMON_T_INPUT,
- 0
-};
-
-static const struct hwmon_channel_info w1_temp = {
- .type = hwmon_temp,
- .config = w1_temp_config,
-};
-
static const struct hwmon_channel_info * const w1_info[] = {
- &w1_temp,
+ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
NULL
};
--
2.22.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: (subset) [PATCH v1 8/9] w1: w1_therm: w1: Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 ` [PATCH v1 8/9] w1: w1_therm: w1: " Huisong Li
@ 2025-02-03 11:56 ` Krzysztof Kozlowski
2025-02-05 2:10 ` lihuisong (C)
0 siblings, 1 reply; 18+ messages in thread
From: Krzysztof Kozlowski @ 2025-02-03 11:56 UTC (permalink / raw)
To: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc,
Huisong Li
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong
On Fri, 24 Jan 2025 10:26:34 +0800, Huisong Li wrote:
> Use HWMON_CHANNEL_INFO macro to simplify code.
>
>
Applied, thanks!
[8/9] w1: w1_therm: w1: Use HWMON_CHANNEL_INFO macro to simplify code
https://git.kernel.org/krzk/linux-w1/c/33c145297840dddf0dc23d5822159c26aba920d3
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: (subset) [PATCH v1 8/9] w1: w1_therm: w1: Use HWMON_CHANNEL_INFO macro to simplify code
2025-02-03 11:56 ` (subset) " Krzysztof Kozlowski
@ 2025-02-05 2:10 ` lihuisong (C)
0 siblings, 0 replies; 18+ messages in thread
From: lihuisong (C) @ 2025-02-05 2:10 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong,
linux-hwmon, linux-kernel, linux-media, linux-rtc, netdev
在 2025/2/3 19:56, Krzysztof Kozlowski 写道:
> On Fri, 24 Jan 2025 10:26:34 +0800, Huisong Li wrote:
>> Use HWMON_CHANNEL_INFO macro to simplify code.
>>
>>
> Applied, thanks!
>
> [8/9] w1: w1_therm: w1: Use HWMON_CHANNEL_INFO macro to simplify code
> https://git.kernel.org/krzk/linux-w1/c/33c145297840dddf0dc23d5822159c26aba920d3
>
Thanks for picking it up.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v1 9/9] net: phy: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
` (7 preceding siblings ...)
2025-01-24 2:26 ` [PATCH v1 8/9] w1: w1_therm: w1: " Huisong Li
@ 2025-01-24 2:26 ` Huisong Li
2025-01-24 15:08 ` [PATCH v1 0/9] " Andrew Lunn
2025-01-24 16:58 ` Krzysztof Kozlowski
10 siblings, 0 replies; 18+ messages in thread
From: Huisong Li @ 2025-01-24 2:26 UTC (permalink / raw)
To: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong,
lihuisong
Use HWMON_CHANNEL_INFO macro to simplify code.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
drivers/net/phy/aquantia/aquantia_hwmon.c | 32 +++++------------------
1 file changed, 6 insertions(+), 26 deletions(-)
diff --git a/drivers/net/phy/aquantia/aquantia_hwmon.c b/drivers/net/phy/aquantia/aquantia_hwmon.c
index 7b3c49c3bf49..02b7a2639bbb 100644
--- a/drivers/net/phy/aquantia/aquantia_hwmon.c
+++ b/drivers/net/phy/aquantia/aquantia_hwmon.c
@@ -172,33 +172,13 @@ static const struct hwmon_ops aqr_hwmon_ops = {
.write = aqr_hwmon_write,
};
-static u32 aqr_hwmon_chip_config[] = {
- HWMON_C_REGISTER_TZ,
- 0,
-};
-
-static const struct hwmon_channel_info aqr_hwmon_chip = {
- .type = hwmon_chip,
- .config = aqr_hwmon_chip_config,
-};
-
-static u32 aqr_hwmon_temp_config[] = {
- HWMON_T_INPUT |
- HWMON_T_MAX | HWMON_T_MIN |
- HWMON_T_MAX_ALARM | HWMON_T_MIN_ALARM |
- HWMON_T_CRIT | HWMON_T_LCRIT |
- HWMON_T_CRIT_ALARM | HWMON_T_LCRIT_ALARM,
- 0,
-};
-
-static const struct hwmon_channel_info aqr_hwmon_temp = {
- .type = hwmon_temp,
- .config = aqr_hwmon_temp_config,
-};
-
static const struct hwmon_channel_info * const aqr_hwmon_info[] = {
- &aqr_hwmon_chip,
- &aqr_hwmon_temp,
+ HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
+ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT |
+ HWMON_T_MAX | HWMON_T_MIN |
+ HWMON_T_MAX_ALARM | HWMON_T_MIN_ALARM |
+ HWMON_T_CRIT | HWMON_T_LCRIT |
+ HWMON_T_CRIT_ALARM | HWMON_T_LCRIT_ALARM),
NULL,
};
--
2.22.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
` (8 preceding siblings ...)
2025-01-24 2:26 ` [PATCH v1 9/9] net: phy: aquantia: " Huisong Li
@ 2025-01-24 15:08 ` Andrew Lunn
2025-01-24 15:41 ` Guenter Roeck
2025-02-05 2:05 ` lihuisong (C)
2025-01-24 16:58 ` Krzysztof Kozlowski
10 siblings, 2 replies; 18+ messages in thread
From: Andrew Lunn @ 2025-01-24 15:08 UTC (permalink / raw)
To: Huisong Li
Cc: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc,
oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong
On Fri, Jan 24, 2025 at 10:26:26AM +0800, Huisong Li wrote:
> The HWMON_CHANNEL_INFO macro is provided by hwmon.h and used widely by many
> other drivers. This series use HWMON_CHANNEL_INFO macro to simplify code.
>
> Huisong Li (9):
> media: video-i2c: Use HWMON_CHANNEL_INFO macro to simplify code
> net: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code
> net: nfp: Use HWMON_CHANNEL_INFO macro to simplify code
> net: phy: marvell: Use HWMON_CHANNEL_INFO macro to simplify code
> net: phy: marvell10g: Use HWMON_CHANNEL_INFO macro to simplify code
> rtc: ab-eoz9: Use HWMON_CHANNEL_INFO macro to simplify code
> rtc: ds3232: Use HWMON_CHANNEL_INFO macro to simplify code
> w1: w1_therm: w1: Use HWMON_CHANNEL_INFO macro to simplify code
> net: phy: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code
Please split these patches per subsystem. Maintainers generally have
scripts to accept patches, and those scripts don't work when there are
patches for other Maintainers mixed in. So you need 4 patchsets,
media, net, rtc and w1.
I would also like to see the HWMON Maintainers opinion on these. A
patchset containing these have already been NACKed once. These patches
do however look like valid cleanups. But are they just so you can do
something bad in your vendor tree, which will never make it to
mainline?
Andrew
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 15:08 ` [PATCH v1 0/9] " Andrew Lunn
@ 2025-01-24 15:41 ` Guenter Roeck
2025-02-05 2:08 ` lihuisong (C)
2025-02-05 2:05 ` lihuisong (C)
1 sibling, 1 reply; 18+ messages in thread
From: Guenter Roeck @ 2025-01-24 15:41 UTC (permalink / raw)
To: Andrew Lunn, Huisong Li
Cc: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc,
oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong
On 1/24/25 07:08, Andrew Lunn wrote:
> On Fri, Jan 24, 2025 at 10:26:26AM +0800, Huisong Li wrote:
>> The HWMON_CHANNEL_INFO macro is provided by hwmon.h and used widely by many
>> other drivers. This series use HWMON_CHANNEL_INFO macro to simplify code.
>>
>> Huisong Li (9):
>> media: video-i2c: Use HWMON_CHANNEL_INFO macro to simplify code
>> net: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code
>> net: nfp: Use HWMON_CHANNEL_INFO macro to simplify code
>> net: phy: marvell: Use HWMON_CHANNEL_INFO macro to simplify code
>> net: phy: marvell10g: Use HWMON_CHANNEL_INFO macro to simplify code
>> rtc: ab-eoz9: Use HWMON_CHANNEL_INFO macro to simplify code
>> rtc: ds3232: Use HWMON_CHANNEL_INFO macro to simplify code
>> w1: w1_therm: w1: Use HWMON_CHANNEL_INFO macro to simplify code
>> net: phy: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code
>
> Please split these patches per subsystem. Maintainers generally have
> scripts to accept patches, and those scripts don't work when there are
> patches for other Maintainers mixed in. So you need 4 patchsets,
> media, net, rtc and w1.
>
> I would also like to see the HWMON Maintainers opinion on these. A
> patchset containing these have already been NACKed once. These patches
> do however look like valid cleanups. But are they just so you can do
> something bad in your vendor tree, which will never make it to
> mainline?
>
I no longer comment on hwmon related changes outside drivers/hwmon/
unless there are blatant problems such as someone trying to use an obsolete
API or abusing the current API.
Guenter
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 15:41 ` Guenter Roeck
@ 2025-02-05 2:08 ` lihuisong (C)
0 siblings, 0 replies; 18+ messages in thread
From: lihuisong (C) @ 2025-02-05 2:08 UTC (permalink / raw)
To: Guenter Roeck, Andrew Lunn
Cc: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc,
oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong
在 2025/1/24 23:41, Guenter Roeck 写道:
> On 1/24/25 07:08, Andrew Lunn wrote:
>> On Fri, Jan 24, 2025 at 10:26:26AM +0800, Huisong Li wrote:
>>> The HWMON_CHANNEL_INFO macro is provided by hwmon.h and used widely
>>> by many
>>> other drivers. This series use HWMON_CHANNEL_INFO macro to simplify
>>> code.
>>>
>>> Huisong Li (9):
>>> media: video-i2c: Use HWMON_CHANNEL_INFO macro to simplify code
>>> net: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code
>>> net: nfp: Use HWMON_CHANNEL_INFO macro to simplify code
>>> net: phy: marvell: Use HWMON_CHANNEL_INFO macro to simplify code
>>> net: phy: marvell10g: Use HWMON_CHANNEL_INFO macro to simplify code
>>> rtc: ab-eoz9: Use HWMON_CHANNEL_INFO macro to simplify code
>>> rtc: ds3232: Use HWMON_CHANNEL_INFO macro to simplify code
>>> w1: w1_therm: w1: Use HWMON_CHANNEL_INFO macro to simplify code
>>> net: phy: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code
>>
>> Please split these patches per subsystem. Maintainers generally have
>> scripts to accept patches, and those scripts don't work when there are
>> patches for other Maintainers mixed in. So you need 4 patchsets,
>> media, net, rtc and w1.
>>
>> I would also like to see the HWMON Maintainers opinion on these. A
>> patchset containing these have already been NACKed once. These patches
>> do however look like valid cleanups. But are they just so you can do
>> something bad in your vendor tree, which will never make it to
>> mainline?
>>
>
> I no longer comment on hwmon related changes outside drivers/hwmon/
> unless there are blatant problems such as someone trying to use an
> obsolete
> API or abusing the current API.
>
>
All right. Let subsystem maintainer to decide if need to pick it up.
>
> .
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 15:08 ` [PATCH v1 0/9] " Andrew Lunn
2025-01-24 15:41 ` Guenter Roeck
@ 2025-02-05 2:05 ` lihuisong (C)
1 sibling, 0 replies; 18+ messages in thread
From: lihuisong (C) @ 2025-02-05 2:05 UTC (permalink / raw)
To: Andrew Lunn
Cc: linux-hwmon, linux-kernel, linux-media, netdev, linux-rtc,
oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, krzk, zhanjie9, zhenglifeng1, liuyonglong
Hi Andrew,
在 2025/1/24 23:08, Andrew Lunn 写道:
> On Fri, Jan 24, 2025 at 10:26:26AM +0800, Huisong Li wrote:
>> The HWMON_CHANNEL_INFO macro is provided by hwmon.h and used widely by many
>> other drivers. This series use HWMON_CHANNEL_INFO macro to simplify code.
>>
>> Huisong Li (9):
>> media: video-i2c: Use HWMON_CHANNEL_INFO macro to simplify code
>> net: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code
>> net: nfp: Use HWMON_CHANNEL_INFO macro to simplify code
>> net: phy: marvell: Use HWMON_CHANNEL_INFO macro to simplify code
>> net: phy: marvell10g: Use HWMON_CHANNEL_INFO macro to simplify code
>> rtc: ab-eoz9: Use HWMON_CHANNEL_INFO macro to simplify code
>> rtc: ds3232: Use HWMON_CHANNEL_INFO macro to simplify code
>> w1: w1_therm: w1: Use HWMON_CHANNEL_INFO macro to simplify code
>> net: phy: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code
> Please split these patches per subsystem. Maintainers generally have
> scripts to accept patches, and those scripts don't work when there are
> patches for other Maintainers mixed in. So you need 4 patchsets,
> media, net, rtc and w1.
Many thanks for your reply and good suggestion.
I will split them.
>
> I would also like to see the HWMON Maintainers opinion on these. A
> patchset containing these have already been NACKed once. These patches
> do however look like valid cleanups. But are they just so you can do
> something bad in your vendor tree, which will never make it to
> mainline?
>
> Andrew
>
> .
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 2:26 [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
` (9 preceding siblings ...)
2025-01-24 15:08 ` [PATCH v1 0/9] " Andrew Lunn
@ 2025-01-24 16:58 ` Krzysztof Kozlowski
2025-02-05 1:55 ` lihuisong (C)
10 siblings, 1 reply; 18+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-24 16:58 UTC (permalink / raw)
To: Huisong Li, linux-hwmon, linux-kernel, linux-media, netdev,
linux-rtc
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, zhanjie9, zhenglifeng1, liuyonglong
On 24/01/2025 03:26, Huisong Li wrote:
> The HWMON_CHANNEL_INFO macro is provided by hwmon.h and used widely by many
> other drivers. This series use HWMON_CHANNEL_INFO macro to simplify code.
>
Read the feedback given to you last time. I do not see how you addressed
this:
"Avoid combining independent patches into one patch bomb. Or explain the
dependencies and how is it supposed to be merged - that's why you have
cover letter here."
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH v1 0/9] Use HWMON_CHANNEL_INFO macro to simplify code
2025-01-24 16:58 ` Krzysztof Kozlowski
@ 2025-02-05 1:55 ` lihuisong (C)
0 siblings, 0 replies; 18+ messages in thread
From: lihuisong (C) @ 2025-02-05 1:55 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: oss-drivers, matt, mchehab, irusskikh, andrew+netdev, davem,
edumazet, kuba, pabeni, louis.peens, hkallweit1, linux, kabel,
alexandre.belloni, zhanjie9, zhenglifeng1, liuyonglong,
linux-hwmon, linux-media, linux-kernel, linux-rtc, netdev
在 2025/1/25 0:58, Krzysztof Kozlowski 写道:
> On 24/01/2025 03:26, Huisong Li wrote:
>> The HWMON_CHANNEL_INFO macro is provided by hwmon.h and used widely by many
>> other drivers. This series use HWMON_CHANNEL_INFO macro to simplify code.
>>
> Read the feedback given to you last time. I do not see how you addressed
> this:
>
> "Avoid combining independent patches into one patch bomb. Or explain the
> dependencies and how is it supposed to be merged - that's why you have
> cover letter here."
Sorry. I got it now. Thank you for telling me again.😁
There is no any dependency for this series.
I will split these patches as Andrew suggested.
^ permalink raw reply [flat|nested] 18+ messages in thread