ASoC: byt-max98090: Register jacks at the card level
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 4 Mar 2015 09:33:22 +0000 (10:33 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 4 Mar 2015 17:09:52 +0000 (17:09 +0000)
The jacks are card level elements so use snd_soc_card_jack_new() instead of
snd_soc_jack_new() to register them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/byt-max98090.c

index 9832afe7d22cb082e3d54dffce9f723f947716d7..d8b1f038da1c41ac9674b94efb072ca1e5c24f41 100644 (file)
@@ -84,7 +84,6 @@ static struct snd_soc_jack_gpio hs_jack_gpios[] = {
 static int byt_max98090_init(struct snd_soc_pcm_runtime *runtime)
 {
        int ret;
-       struct snd_soc_codec *codec = runtime->codec;
        struct snd_soc_card *card = runtime->card;
        struct byt_max98090_private *drv = snd_soc_card_get_drvdata(card);
        struct snd_soc_jack *jack = &drv->jack;
@@ -100,13 +99,9 @@ static int byt_max98090_init(struct snd_soc_pcm_runtime *runtime)
        }
 
        /* Enable jack detection */
-       ret = snd_soc_jack_new(codec, "Headset",
-                              SND_JACK_LINEOUT | SND_JACK_HEADSET, jack);
-       if (ret)
-               return ret;
-
-       ret = snd_soc_jack_add_pins(jack, ARRAY_SIZE(hs_jack_pins),
-                                   hs_jack_pins);
+       ret = snd_soc_card_jack_new(runtime->card, "Headset",
+                                   SND_JACK_LINEOUT | SND_JACK_HEADSET, jack,
+                                   hs_jack_pins, ARRAY_SIZE(hs_jack_pins));
        if (ret)
                return ret;