summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm0010.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2013-08-28 20:18:13 +0100
committerGrant Likely <grant.likely@linaro.org>2013-08-28 20:18:13 +0100
commit8be137f2664f0abb096626a9d2ce0fcdd955b109 (patch)
tree2c53a5535265a58eb397d6fbbab2ec26e92e6931 /sound/soc/codecs/wm0010.c
parent8851b9f1625ce0858e9b1bb0ae4a57d4b43178b1 (diff)
parentd8dfad3876e4386666b759da3c833d62fb8b2267 (diff)
downloadlinux-8be137f2664f0abb096626a9d2ce0fcdd955b109.tar.gz
linux-8be137f2664f0abb096626a9d2ce0fcdd955b109.tar.bz2
linux-8be137f2664f0abb096626a9d2ce0fcdd955b109.zip
Merge tag 'v3.11-rc7' into devicetree/next
Linux 3.11-rc7
Diffstat (limited to 'sound/soc/codecs/wm0010.c')
-rw-r--r--sound/soc/codecs/wm0010.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c
index f5e835662cdc..10adc4145d46 100644
--- a/sound/soc/codecs/wm0010.c
+++ b/sound/soc/codecs/wm0010.c
@@ -410,6 +410,16 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec)
rec->command, rec->length);
len = rec->length + 8;
+ xfer = kzalloc(sizeof(*xfer), GFP_KERNEL);
+ if (!xfer) {
+ dev_err(codec->dev, "Failed to allocate xfer\n");
+ ret = -ENOMEM;
+ goto abort;
+ }
+
+ xfer->codec = codec;
+ list_add_tail(&xfer->list, &xfer_list);
+
out = kzalloc(len, GFP_KERNEL);
if (!out) {
dev_err(codec->dev,
@@ -417,6 +427,7 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec)
ret = -ENOMEM;
goto abort1;
}
+ xfer->t.rx_buf = out;
img = kzalloc(len, GFP_KERNEL);
if (!img) {
@@ -425,24 +436,13 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec)
ret = -ENOMEM;
goto abort1;
}
+ xfer->t.tx_buf = img;
byte_swap_64((u64 *)&rec->command, img, len);
- xfer = kzalloc(sizeof(*xfer), GFP_KERNEL);
- if (!xfer) {
- dev_err(codec->dev, "Failed to allocate xfer\n");
- ret = -ENOMEM;
- goto abort1;
- }
-
- xfer->codec = codec;
- list_add_tail(&xfer->list, &xfer_list);
-
spi_message_init(&xfer->m);
xfer->m.complete = wm0010_boot_xfer_complete;
xfer->m.context = xfer;
- xfer->t.tx_buf = img;
- xfer->t.rx_buf = out;
xfer->t.len = len;
xfer->t.bits_per_word = 8;