From: Axel Lin Date: Wed, 16 Nov 2016 13:08:42 +0000 (+0800) Subject: ASoC: rt5665: Use devm_gpio_request_one() X-Git-Tag: v4.10-rc1~121^2~3^2~4^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f2826c1fe5d071fa437d337c41df979b60f0fc32;p=karo-tx-linux.git ASoC: rt5665: Use devm_gpio_request_one() Simplify the code a bit. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c index 7dfaaf1c2d14..324461e985b3 100644 --- a/sound/soc/codecs/rt5665.c +++ b/sound/soc/codecs/rt5665.c @@ -4677,11 +4677,9 @@ static int rt5665_i2c_probe(struct i2c_client *i2c, } if (gpio_is_valid(rt5665->pdata.ldo1_en)) { - if (devm_gpio_request(&i2c->dev, rt5665->pdata.ldo1_en, - "rt5665")) + if (devm_gpio_request_one(&i2c->dev, rt5665->pdata.ldo1_en, + GPIOF_OUT_INIT_HIGH, "rt5665")) dev_err(&i2c->dev, "Fail gpio_request gpio_ldo\n"); - else if (gpio_direction_output(rt5665->pdata.ldo1_en, 1)) - dev_err(&i2c->dev, "Fail gpio_direction gpio_ldo\n"); } /* Sleep for 300 ms miniumum */