diff mbox series

[2/3] hwmon: (asus_wmi_sensors) split out T_Sensor

Message ID 20211003133344.9036-3-oleksandr@natalenko.name (mailing list archive)
State Changes Requested
Headers show
Series hwmon: add ASUS Pro WS X570-ACE support | expand

Commit Message

Oleksandr Natalenko Oct. 3, 2021, 1:33 p.m. UTC
Move `T_Sensor` addition into a separate `case` statement in preparation
for the next patch that introduces a board without it.

No functional change.

Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
---
 drivers/hwmon/asus_wmi_sensors.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

Comments

Guenter Roeck Oct. 11, 2021, 2:25 p.m. UTC | #1
On Sun, Oct 03, 2021 at 03:33:43PM +0200, Oleksandr Natalenko wrote:
> Move `T_Sensor` addition into a separate `case` statement in preparation
> for the next patch that introduces a board without it.
> 
> No functional change.
> 
> Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>

This patch depends on acceptance of the asus_wmi_sensors driver,
which should at least be mentioned here. The same applies to the
next patch of the series. In general, please do not send patches
for multiple drivers as single series, and please always mention
such dependencies.

Thanks,
Guenter

> ---
>  drivers/hwmon/asus_wmi_sensors.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hwmon/asus_wmi_sensors.c b/drivers/hwmon/asus_wmi_sensors.c
> index 6b04fad18891..98e761861601 100644
> --- a/drivers/hwmon/asus_wmi_sensors.c
> +++ b/drivers/hwmon/asus_wmi_sensors.c
> @@ -144,14 +144,22 @@ static void asus_wmi_ec_fill_board_sensors(struct asus_wmi_ec_info *ec, int boar
>  		asus_wmi_ec_set_sensor_info(si++, "Motherboard", hwmon_temp,
>  					    asus_wmi_ec_make_sensor_address(1, 0x00, 0x3C),
>  					    &ec->nr_registers);
> -		asus_wmi_ec_set_sensor_info(si++, "T_Sensor", hwmon_temp,
> -					    asus_wmi_ec_make_sensor_address(1, 0x00, 0x3D),
> -					    &ec->nr_registers);
>  		asus_wmi_ec_set_sensor_info(si++, "VRM", hwmon_temp,
>  					    asus_wmi_ec_make_sensor_address(1, 0x00, 0x3E),
>  					    &ec->nr_registers);
>  	}
>  
> +	switch (board) {
> +	case BOARD_RS_B550_E_G:
> +	case BOARD_RS_X570_E_G:
> +	case BOARD_R_C8H:
> +	case BOARD_R_C8DH:
> +	case BOARD_R_C8F:
> +		asus_wmi_ec_set_sensor_info(si++, "T_Sensor", hwmon_temp,
> +					    asus_wmi_ec_make_sensor_address(1, 0x00, 0x3D),
> +					    &ec->nr_registers);
> +	}
> +
>  	switch (board) {
>  	case BOARD_RS_X570_E_G:
>  	case BOARD_R_C8H:
diff mbox series

Patch

diff --git a/drivers/hwmon/asus_wmi_sensors.c b/drivers/hwmon/asus_wmi_sensors.c
index 6b04fad18891..98e761861601 100644
--- a/drivers/hwmon/asus_wmi_sensors.c
+++ b/drivers/hwmon/asus_wmi_sensors.c
@@ -144,14 +144,22 @@  static void asus_wmi_ec_fill_board_sensors(struct asus_wmi_ec_info *ec, int boar
 		asus_wmi_ec_set_sensor_info(si++, "Motherboard", hwmon_temp,
 					    asus_wmi_ec_make_sensor_address(1, 0x00, 0x3C),
 					    &ec->nr_registers);
-		asus_wmi_ec_set_sensor_info(si++, "T_Sensor", hwmon_temp,
-					    asus_wmi_ec_make_sensor_address(1, 0x00, 0x3D),
-					    &ec->nr_registers);
 		asus_wmi_ec_set_sensor_info(si++, "VRM", hwmon_temp,
 					    asus_wmi_ec_make_sensor_address(1, 0x00, 0x3E),
 					    &ec->nr_registers);
 	}
 
+	switch (board) {
+	case BOARD_RS_B550_E_G:
+	case BOARD_RS_X570_E_G:
+	case BOARD_R_C8H:
+	case BOARD_R_C8DH:
+	case BOARD_R_C8F:
+		asus_wmi_ec_set_sensor_info(si++, "T_Sensor", hwmon_temp,
+					    asus_wmi_ec_make_sensor_address(1, 0x00, 0x3D),
+					    &ec->nr_registers);
+	}
+
 	switch (board) {
 	case BOARD_RS_X570_E_G:
 	case BOARD_R_C8H: