diff mbox series

ALSA: scarlett2: Convert meter levels from little-endian

Message ID ZYsBIE3DSKdi4YC/@m.b4.vu (mailing list archive)
State Accepted
Commit 0b2dca555d78c296de39c0ce29c997e55889d76a
Headers show
Series ALSA: scarlett2: Convert meter levels from little-endian | expand

Commit Message

Geoffrey D. Bennett Dec. 26, 2023, 4:36 p.m. UTC
Add missing conversion from little-endian data to CPU-endian in
scarlett2_usb_get_meter_levels().

Fixes: 3473185f31df ("ALSA: scarlett2: Remap Level Meter values")
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
---

Hi Takashi,

Can you add this to 6.7-rc8 please.

Thanks,
Geoffrey.

 sound/usb/mixer_scarlett2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Takashi Iwai Dec. 29, 2023, 2:40 p.m. UTC | #1
On Tue, 26 Dec 2023 17:36:48 +0100,
Geoffrey D. Bennett wrote:
> 
> Add missing conversion from little-endian data to CPU-endian in
> scarlett2_usb_get_meter_levels().
> 
> Fixes: 3473185f31df ("ALSA: scarlett2: Remap Level Meter values")
> Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
> ---
> 
> Hi Takashi,
> 
> Can you add this to 6.7-rc8 please.

Applied to for-linus branch.  I'm going to send a PR for 6.7 final in
the next week.


thanks,

Takashi
diff mbox series

Patch

diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c
index e25f004e50e4..e5d8543f9686 100644
--- a/sound/usb/mixer_scarlett2.c
+++ b/sound/usb/mixer_scarlett2.c
@@ -2110,7 +2110,7 @@  static int scarlett2_usb_get_meter_levels(struct usb_mixer_interface *mixer,
 		__le16 num_meters;
 		__le32 magic;
 	} __packed req;
-	u32 resp[SCARLETT2_MAX_METERS];
+	__le32 resp[SCARLETT2_MAX_METERS];
 	int i, err;
 
 	req.pad = 0;
@@ -2123,7 +2123,7 @@  static int scarlett2_usb_get_meter_levels(struct usb_mixer_interface *mixer,
 
 	/* copy, convert to u16 */
 	for (i = 0; i < num_meters; i++)
-		levels[i] = resp[i];
+		levels[i] = le32_to_cpu(resp[i]);
 
 	return 0;
 }