Skip to content

Commit

Permalink
ASoC: wl1273: Use table based control setup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Nov 5, 2014
1 parent f114040 commit c8b5d08
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions sound/soc/codecs/wl1273.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ static int wl1273_probe(struct snd_soc_codec *codec)
{
struct wl1273_core **core = codec->dev->platform_data;
struct wl1273_priv *wl1273;
int r;

dev_dbg(codec->dev, "%s.\n", __func__);

Expand All @@ -470,12 +469,7 @@ static int wl1273_probe(struct snd_soc_codec *codec)

snd_soc_codec_set_drvdata(codec, wl1273);

r = snd_soc_add_codec_controls(codec, wl1273_controls,
ARRAY_SIZE(wl1273_controls));
if (r)
kfree(wl1273);

return r;
return 0;
}

static int wl1273_remove(struct snd_soc_codec *codec)
Expand All @@ -492,6 +486,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wl1273 = {
.probe = wl1273_probe,
.remove = wl1273_remove,

.controls = wl1273_controls,
.num_controls = ARRAY_SIZE(wl1273_controls),
.dapm_widgets = wl1273_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(wl1273_dapm_widgets),
.dapm_routes = wl1273_dapm_routes,
Expand Down

0 comments on commit c8b5d08

Please sign in to comment.