Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2826c1f authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

ASoC: rt5665: Use devm_gpio_request_one()



Simplify the code a bit.

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0c95666f
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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 */