diff options
Diffstat (limited to 'sound/soc/codecs/wm0010.c')
| -rw-r--r-- | sound/soc/codecs/wm0010.c | 24 |
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) | |||
| 410 | rec->command, rec->length); | 410 | rec->command, rec->length); |
| 411 | len = rec->length + 8; | 411 | len = rec->length + 8; |
| 412 | 412 | ||
| 413 | xfer = kzalloc(sizeof(*xfer), GFP_KERNEL); | ||
| 414 | if (!xfer) { | ||
| 415 | dev_err(codec->dev, "Failed to allocate xfer\n"); | ||
| 416 | ret = -ENOMEM; | ||
| 417 | goto abort; | ||
| 418 | } | ||
| 419 | |||
| 420 | xfer->codec = codec; | ||
| 421 | list_add_tail(&xfer->list, &xfer_list); | ||
| 422 | |||
| 413 | out = kzalloc(len, GFP_KERNEL); | 423 | out = kzalloc(len, GFP_KERNEL); |
| 414 | if (!out) { | 424 | if (!out) { |
| 415 | dev_err(codec->dev, | 425 | dev_err(codec->dev, |
| @@ -417,6 +427,7 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) | |||
| 417 | ret = -ENOMEM; | 427 | ret = -ENOMEM; |
| 418 | goto abort1; | 428 | goto abort1; |
| 419 | } | 429 | } |
| 430 | xfer->t.rx_buf = out; | ||
| 420 | 431 | ||
| 421 | img = kzalloc(len, GFP_KERNEL); | 432 | img = kzalloc(len, GFP_KERNEL); |
| 422 | if (!img) { | 433 | if (!img) { |
| @@ -425,24 +436,13 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) | |||
| 425 | ret = -ENOMEM; | 436 | ret = -ENOMEM; |
| 426 | goto abort1; | 437 | goto abort1; |
| 427 | } | 438 | } |
| 439 | xfer->t.tx_buf = img; | ||
| 428 | 440 | ||
| 429 | byte_swap_64((u64 *)&rec->command, img, len); | 441 | byte_swap_64((u64 *)&rec->command, img, len); |
| 430 | 442 | ||
| 431 | xfer = kzalloc(sizeof(*xfer), GFP_KERNEL); | ||
| 432 | if (!xfer) { | ||
| 433 | dev_err(codec->dev, "Failed to allocate xfer\n"); | ||
| 434 | ret = -ENOMEM; | ||
| 435 | goto abort1; | ||
| 436 | } | ||
| 437 | |||
| 438 | xfer->codec = codec; | ||
| 439 | list_add_tail(&xfer->list, &xfer_list); | ||
| 440 | |||
| 441 | spi_message_init(&xfer->m); | 443 | spi_message_init(&xfer->m); |
| 442 | xfer->m.complete = wm0010_boot_xfer_complete; | 444 | xfer->m.complete = wm0010_boot_xfer_complete; |
| 443 | xfer->m.context = xfer; | 445 | xfer->m.context = xfer; |
| 444 | xfer->t.tx_buf = img; | ||
| 445 | xfer->t.rx_buf = out; | ||
| 446 | xfer->t.len = len; | 446 | xfer->t.len = len; |
| 447 | xfer->t.bits_per_word = 8; | 447 | xfer->t.bits_per_word = 8; |
| 448 | 448 | ||
