diff mbox series

[v2,2/2] hwmon (it87): Generalise matching labels

Message ID 20230318080543.1226700-3-frank@crawford.emu.id.au (mailing list archive)
State Accepted
Headers show
Series hwmon (it87): Add scaling macro for recent ADC voltages | expand

Commit Message

Frank Crawford March 18, 2023, 8:05 a.m. UTC
Apply scaling macro to match the labels for internal voltage sensors.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
---

v2:
 * Split out the change to match labels to a separate patch.

---
 drivers/hwmon/it87.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck March 21, 2023, 3:02 p.m. UTC | #1
On Sat, Mar 18, 2023 at 07:05:43PM +1100, Frank Crawford wrote:
> Apply scaling macro to match the labels for internal voltage sensors.
> 
> Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>

Applied. Please note that I updated the subject because "Generalise
matching labels" didn't really describe what the patch is doing.

> ---
> 
> v2:
>  * Split out the change to match labels to a separate patch.
> 
> ---
>  drivers/hwmon/it87.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
> index e9614eb557d4..f774a0732a7c 100644
> --- a/drivers/hwmon/it87.c
> +++ b/drivers/hwmon/it87.c
> @@ -2004,7 +2004,7 @@ static ssize_t show_label(struct device *dev, struct device_attribute *attr,
>  
>  	if (has_vin3_5v(data) && nr == 0)
>  		label = labels[0];
> -	else if (has_12mv_adc(data) || has_10_9mv_adc(data))
> +	else if (has_scaling(data))
>  		label = labels_it8721[nr];
>  	else
>  		label = labels[nr];
diff mbox series

Patch

diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index e9614eb557d4..f774a0732a7c 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -2004,7 +2004,7 @@  static ssize_t show_label(struct device *dev, struct device_attribute *attr,
 
 	if (has_vin3_5v(data) && nr == 0)
 		label = labels[0];
-	else if (has_12mv_adc(data) || has_10_9mv_adc(data))
+	else if (has_scaling(data))
 		label = labels_it8721[nr];
 	else
 		label = labels[nr];