Skip to content

Commit

Permalink
ASoC: rt5665: Use devm_gpio_request_one()
Browse files Browse the repository at this point in the history
Simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Nov 16, 2016
1 parent 0c95666 commit f2826c1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sound/soc/codecs/rt5665.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit f2826c1

Please sign in to comment.