diff options
| author | Axel Lin <axel.lin@ingics.com> | 2016-11-16 08:08:42 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2016-11-16 11:27:29 -0500 |
| commit | f2826c1fe5d071fa437d337c41df979b60f0fc32 (patch) | |
| tree | 0e1a00bafbe138ef38a04784780ca6d96d2b4d48 | |
| parent | 0c95666f0d7364e364ab53e068f7891c98e90012 (diff) | |
ASoC: rt5665: Use devm_gpio_request_one()
Simplify the code a bit.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | sound/soc/codecs/rt5665.c | 6 |
1 files changed, 2 insertions, 4 deletions
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, | |||
| 4677 | } | 4677 | } |
| 4678 | 4678 | ||
| 4679 | if (gpio_is_valid(rt5665->pdata.ldo1_en)) { | 4679 | if (gpio_is_valid(rt5665->pdata.ldo1_en)) { |
| 4680 | if (devm_gpio_request(&i2c->dev, rt5665->pdata.ldo1_en, | 4680 | if (devm_gpio_request_one(&i2c->dev, rt5665->pdata.ldo1_en, |
| 4681 | "rt5665")) | 4681 | GPIOF_OUT_INIT_HIGH, "rt5665")) |
| 4682 | dev_err(&i2c->dev, "Fail gpio_request gpio_ldo\n"); | 4682 | dev_err(&i2c->dev, "Fail gpio_request gpio_ldo\n"); |
| 4683 | else if (gpio_direction_output(rt5665->pdata.ldo1_en, 1)) | ||
| 4684 | dev_err(&i2c->dev, "Fail gpio_direction gpio_ldo\n"); | ||
| 4685 | } | 4683 | } |
| 4686 | 4684 | ||
| 4687 | /* Sleep for 300 ms miniumum */ | 4685 | /* Sleep for 300 ms miniumum */ |
