diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-07-25 17:59:26 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2018-12-16 22:08:25 +0000 |
commit | 7e9a97bc680f238b733470e1942154d0ff864c8d (patch) | |
tree | 97e72a05aca1ef341d6e92dbea6b6a4038bb68d3 /sound | |
parent | c51e8e322b73de19513d6c97572a6e2a598d5ce9 (diff) | |
download | linux-stable-7e9a97bc680f238b733470e1942154d0ff864c8d.tar.gz linux-stable-7e9a97bc680f238b733470e1942154d0ff864c8d.tar.bz2 linux-stable-7e9a97bc680f238b733470e1942154d0ff864c8d.zip |
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/cs5535audio/cs5535audio.h | 6 | ||||
-rw-r--r-- | sound/pci/cs5535audio/cs5535audio_pcm.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio.h b/sound/pci/cs5535audio/cs5535audio.h index 0579daa62215..425d1b664029 100644 --- a/sound/pci/cs5535audio/cs5535audio.h +++ b/sound/pci/cs5535audio/cs5535audio.h @@ -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 { diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c index 9c2dc911d8d7..709f1c584d3e 100644 --- a/sound/pci/cs5535audio/cs5535audio_pcm.c +++ b/sound/pci/cs5535audio/cs5535audio_pcm.c @@ -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; |