提交 b0053aaa 编写于 作者: J Jingoo Han 提交者: Bryan Wu

leds: renesas: use gpio_request_one

Using gpio_request_one can make the code simpler because it can
set the direction and initial value in one shot.
Signed-off-by: NJingoo Han <jg1.han@samsung.com>
Signed-off-by: NBryan Wu <cooloney@gmail.com>
上级 31c3dc74
......@@ -204,10 +204,10 @@ static void r_tpu_set_pin(struct r_tpu_priv *p, enum r_tpu_pin new_state,
if (p->pin_state == R_TPU_PIN_GPIO_FN)
gpio_free(cfg->pin_gpio_fn);
if (new_state == R_TPU_PIN_GPIO) {
gpio_request(cfg->pin_gpio, cfg->name);
gpio_direction_output(cfg->pin_gpio, !!brightness);
}
if (new_state == R_TPU_PIN_GPIO)
gpio_request_one(cfg->pin_gpio, GPIOF_DIR_OUT | !!brightness,
cfg->name);
if (new_state == R_TPU_PIN_GPIO_FN)
gpio_request(cfg->pin_gpio_fn, cfg->name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册