ASoC: qi_lb60: Pass flags to gpiod_get()
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 25 Nov 2014 19:29:40 +0000 (20:29 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 25 Nov 2014 19:37:01 +0000 (19:37 +0000)
Pass flags to gpiod_get() to automatically configure the GPIOs. This is shorter
and not passing any flags to gpiod_get() will eventually no longer be supported.

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

index 5cb91f9e86261b03afcb70583cd83f17ec3e4729..0fb7d2a91c3a021de7a0038b649bd6c566ad7fb9 100644 (file)
@@ -77,25 +77,18 @@ static int qi_lb60_probe(struct platform_device *pdev)
 {
        struct qi_lb60 *qi_lb60;
        struct snd_soc_card *card = &qi_lb60_card;
-       int ret;
 
        qi_lb60 = devm_kzalloc(&pdev->dev, sizeof(*qi_lb60), GFP_KERNEL);
        if (!qi_lb60)
                return -ENOMEM;
 
-       qi_lb60->snd_gpio = devm_gpiod_get(&pdev->dev, "snd");
+       qi_lb60->snd_gpio = devm_gpiod_get(&pdev->dev, "snd", GPIOD_OUT_LOW);
        if (IS_ERR(qi_lb60->snd_gpio))
                return PTR_ERR(qi_lb60->snd_gpio);
-       ret = gpiod_direction_output(qi_lb60->snd_gpio, 0);
-       if (ret)
-               return ret;
 
-       qi_lb60->amp_gpio = devm_gpiod_get(&pdev->dev, "amp");
+       qi_lb60->amp_gpio = devm_gpiod_get(&pdev->dev, "amp", GPIOD_OUT_LOW);
        if (IS_ERR(qi_lb60->amp_gpio))
                return PTR_ERR(qi_lb60->amp_gpio);
-       ret = gpiod_direction_output(qi_lb60->amp_gpio, 0);
-       if (ret)
-               return ret;
 
        card->dev = &pdev->dev;