All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
To: jdelvare@suse.com, linux@roeck-us.net, linux-hwmon@vger.kernel.org
Cc: chris.packham@alliedtelesis.co.nz, hdegoede@redhat.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/2] hwmon: (adt7475) Display smoothing attributes in correct order
Date: Wed, 22 Feb 2023 13:52:27 +1300	[thread overview]
Message-ID: <20230222005228.158661-2-tony.obrien@alliedtelesis.co.nz> (raw)
In-Reply-To: <20230222005228.158661-1-tony.obrien@alliedtelesis.co.nz>

Throughout the ADT7475 driver, attributes relating to the temperature
sensors are displayed in the order Remote 1, Local, Remote 2.  Make
temp_st_show() conform to this expectation so that values set by
temp_st_store() can be displayed using the correct attribute.

Fixes: 8f05bcc33e74 ("hwmon: (adt7475) temperature smoothing")
Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
---
Changes in v2:
- None
 drivers/hwmon/adt7475.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index 51b3d16c3223..77222c35a38e 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -556,11 +556,11 @@ static ssize_t temp_st_show(struct device *dev, struct device_attribute *attr,
 		val = data->enh_acoustics[0] & 0xf;
 		break;
 	case 1:
-		val = (data->enh_acoustics[1] >> 4) & 0xf;
+		val = data->enh_acoustics[1] & 0xf;
 		break;
 	case 2:
 	default:
-		val = data->enh_acoustics[1] & 0xf;
+		val = (data->enh_acoustics[1] >> 4) & 0xf;
 		break;
 	}
 
-- 
2.39.2


  reply	other threads:[~2023-02-22  0:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22  0:52 [PATCH v2 0/2] hwmon: (adt7475) Fixes for acoustics and hysteresis Tony O'Brien
2023-02-22  0:52 ` Tony O'Brien [this message]
2023-02-25 15:02   ` [PATCH v2 1/2] hwmon: (adt7475) Display smoothing attributes in correct order Guenter Roeck
2023-02-22  0:52 ` [PATCH v2 2/2] hwmon: (adt7475) Fix masking of hysteresis registers Tony O'Brien
2023-02-25 15:03   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230222005228.158661-2-tony.obrien@alliedtelesis.co.nz \
    --to=tony.obrien@alliedtelesis.co.nz \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=hdegoede@redhat.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.