diff mbox series

[v2,1/3] hwmon: tmp513: Fix the channel number in tmp51x_is_visible()

Message ID 20230824204456.401580-2-biju.das.jz@bp.renesas.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series Enhancements for tmp51x driver | expand

Commit Message

Biju Das Aug. 24, 2023, 8:44 p.m. UTC
The supported channels for this driver are {0..3}. Fix the incorrect
channel in tmp51x_is_visible().

Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/all/ea0eccc0-a29f-41e4-9049-a1a13f8b16f1@roeck-us.net/
Fixes: 59dfa75e5d82 ("hwmon: Add driver for Texas Instruments TMP512/513 sensor chips.")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v2:
 * New patch
---
 drivers/hwmon/tmp513.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck Aug. 25, 2023, 1:25 p.m. UTC | #1
On Thu, Aug 24, 2023 at 09:44:54PM +0100, Biju Das wrote:
> The supported channels for this driver are {0..3}. Fix the incorrect
> channel in tmp51x_is_visible().
> 
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Closes: https://lore.kernel.org/all/ea0eccc0-a29f-41e4-9049-a1a13f8b16f1@roeck-us.net/
> Fixes: 59dfa75e5d82 ("hwmon: Add driver for Texas Instruments TMP512/513 sensor chips.")
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Applied.

Thanks,
Guenter

> ---
> v2:
>  * New patch
> ---
>  drivers/hwmon/tmp513.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
> index 7db5d0fc24a4..8ee6e02b02e3 100644
> --- a/drivers/hwmon/tmp513.c
> +++ b/drivers/hwmon/tmp513.c
> @@ -434,7 +434,7 @@ static umode_t tmp51x_is_visible(const void *_data,
>  
>  	switch (type) {
>  	case hwmon_temp:
> -		if (data->id == tmp512 && channel == 4)
> +		if (data->id == tmp512 && channel == 3)
>  			return 0;
>  		switch (attr) {
>  		case hwmon_temp_input:
diff mbox series

Patch

diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
index 7db5d0fc24a4..8ee6e02b02e3 100644
--- a/drivers/hwmon/tmp513.c
+++ b/drivers/hwmon/tmp513.c
@@ -434,7 +434,7 @@  static umode_t tmp51x_is_visible(const void *_data,
 
 	switch (type) {
 	case hwmon_temp:
-		if (data->id == tmp512 && channel == 4)
+		if (data->id == tmp512 && channel == 3)
 			return 0;
 		switch (attr) {
 		case hwmon_temp_input: