Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6479c9e5 authored by Takashi Iwai's avatar Takashi Iwai Committed by Greg Kroah-Hartman
Browse files

ALSA: cs5535audio: Fix invalid endian conversion



commit 69756930f2de0457d51db7d505a1e4f40e9fd116 upstream.

One place in cs5535audio_build_dma_packets() does an extra conversion
via cpu_to_le32(); namely jmpprd_addr is passed to setup_prd() ops,
which writes the value via cs_writel().  That is, the callback does
the conversion by itself, and we don't need to convert beforehand.

This patch fixes that bogus conversion.

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b1e4b1ca
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -66,9 +66,9 @@ struct cs5535audio_dma_ops {
};

struct cs5535audio_dma_desc {
	u32 addr;
	u16 size;
	u16 ctlreserved;
	__le32 addr;
	__le16 size;
	__le16 ctlreserved;
};

struct cs5535audio_dma {
+2 −2
Original line number Diff line number Diff line
@@ -158,8 +158,8 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
	lastdesc->addr = cpu_to_le32((u32) dma->desc_buf.addr);
	lastdesc->size = 0;
	lastdesc->ctlreserved = cpu_to_le16(PRD_JMP);
	jmpprd_addr = cpu_to_le32(lastdesc->addr +
				  (sizeof(struct cs5535audio_dma_desc)*periods));
	jmpprd_addr = (u32)dma->desc_buf.addr +
		sizeof(struct cs5535audio_dma_desc) * periods;

	dma->substream = substream;
	dma->period_bytes = period_bytes;