Skip to content

Commit f2826c1

Browse files
AxelLinbroonie
authored andcommitted
ASoC: rt5665: Use devm_gpio_request_one()
Simplify the code a bit. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 0c95666 commit f2826c1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sound/soc/codecs/rt5665.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4677,11 +4677,9 @@ static int rt5665_i2c_probe(struct i2c_client *i2c,
46774677
}
46784678

46794679
if (gpio_is_valid(rt5665->pdata.ldo1_en)) {
4680-
if (devm_gpio_request(&i2c->dev, rt5665->pdata.ldo1_en,
4681-
"rt5665"))
4680+
if (devm_gpio_request_one(&i2c->dev, rt5665->pdata.ldo1_en,
4681+
GPIOF_OUT_INIT_HIGH, "rt5665"))
46824682
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");
46854683
}
46864684

46874685
/* Sleep for 300 ms miniumum */

0 commit comments

Comments
 (0)