diff options
| author | Lars-Peter Clausen <lars@metafoo.de> | 2014-11-05 04:46:33 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2014-11-05 09:48:40 -0500 |
| commit | c8b5d089d6fd614dfc8a04e3cf087c97486898fb (patch) | |
| tree | 08a7974d4719622a5dfdb34d5133b2df3f243b67 | |
| parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) | |
ASoC: wl1273: Use table based control setup
Makes the code a bit shorter and cleaner.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | sound/soc/codecs/wl1273.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c index f3d4e88d0b7b..00aea4100bb3 100644 --- a/sound/soc/codecs/wl1273.c +++ b/sound/soc/codecs/wl1273.c | |||
| @@ -452,7 +452,6 @@ static int wl1273_probe(struct snd_soc_codec *codec) | |||
| 452 | { | 452 | { |
| 453 | struct wl1273_core **core = codec->dev->platform_data; | 453 | struct wl1273_core **core = codec->dev->platform_data; |
| 454 | struct wl1273_priv *wl1273; | 454 | struct wl1273_priv *wl1273; |
| 455 | int r; | ||
| 456 | 455 | ||
| 457 | dev_dbg(codec->dev, "%s.\n", __func__); | 456 | dev_dbg(codec->dev, "%s.\n", __func__); |
| 458 | 457 | ||
| @@ -470,12 +469,7 @@ static int wl1273_probe(struct snd_soc_codec *codec) | |||
| 470 | 469 | ||
| 471 | snd_soc_codec_set_drvdata(codec, wl1273); | 470 | snd_soc_codec_set_drvdata(codec, wl1273); |
| 472 | 471 | ||
| 473 | r = snd_soc_add_codec_controls(codec, wl1273_controls, | 472 | return 0; |
| 474 | ARRAY_SIZE(wl1273_controls)); | ||
| 475 | if (r) | ||
| 476 | kfree(wl1273); | ||
| 477 | |||
| 478 | return r; | ||
| 479 | } | 473 | } |
| 480 | 474 | ||
| 481 | static int wl1273_remove(struct snd_soc_codec *codec) | 475 | static int wl1273_remove(struct snd_soc_codec *codec) |
| @@ -492,6 +486,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wl1273 = { | |||
| 492 | .probe = wl1273_probe, | 486 | .probe = wl1273_probe, |
| 493 | .remove = wl1273_remove, | 487 | .remove = wl1273_remove, |
| 494 | 488 | ||
| 489 | .controls = wl1273_controls, | ||
| 490 | .num_controls = ARRAY_SIZE(wl1273_controls), | ||
| 495 | .dapm_widgets = wl1273_dapm_widgets, | 491 | .dapm_widgets = wl1273_dapm_widgets, |
| 496 | .num_dapm_widgets = ARRAY_SIZE(wl1273_dapm_widgets), | 492 | .num_dapm_widgets = ARRAY_SIZE(wl1273_dapm_widgets), |
| 497 | .dapm_routes = wl1273_dapm_routes, | 493 | .dapm_routes = wl1273_dapm_routes, |
