From: Mark Brown Date: Tue, 10 May 2011 22:56:13 +0000 (+0200) Subject: ASoC: Convert 7x9 write to use cpu_to_be16() X-Git-Tag: v3.3-rc1~14^2~1009 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f06f136fe0217174657e325279672d4b73ed4d87;p=platform%2Fkernel%2Flinux-3.10.git ASoC: Convert 7x9 write to use cpu_to_be16() Run the data through cpu_to_be16() so it's at least clear what we're up to. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index 6d6395f..dab109f 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c @@ -133,12 +133,11 @@ static unsigned int snd_soc_7_9_read(struct snd_soc_codec *codec, static int snd_soc_7_9_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int value) { - u8 data[2]; + u16 data; - data[0] = (reg << 1) | ((value >> 8) & 0x0001); - data[1] = value & 0x00ff; + data = cpu_to_be16((reg << 9) | (value & 0x1ff)); - return do_hw_write(codec, reg, value, data, 2); + return do_hw_write(codec, reg, value, &data, 2); } #if defined(CONFIG_SPI_MASTER)