gpio: dln2: use assign_bit() where applicable

Convert open-coded if/else with set_bit/clear_bit to the assign_bit API.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20260918141713.3022960-1-peng.fan@oss.nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
This commit is contained in:
Peng Fan 2026-09-18 22:17:13 +08:00 committed by Bartosz Golaszewski
parent b5c2668630
commit b399579a8e

View File

@ -243,10 +243,8 @@ static int dln2_gpio_set_direction(struct gpio_chip *chip, unsigned offset,
if (ret < 0)
return ret;
if (dir == DLN2_GPIO_DIRECTION_OUT)
set_bit(offset, dln2->output_enabled);
else
clear_bit(offset, dln2->output_enabled);
assign_bit(offset, dln2->output_enabled,
dir == DLN2_GPIO_DIRECTION_OUT);
return ret;
}