Skip to content

Commit aaf6223

Browse files
Bartosz Golaszewskibroonie
authored andcommitted
regulator: don't compare raw GPIO descriptor pointers
There's no API contract saying that two GPIO descriptor pointers obtained with a call to gpiod_get() (or one of the variants), that refer to the same physical GPIO pin, always point to the same structure. Use the dedicated comparator function. Signed-off-by: Bartosz Golaszewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 265daff commit aaf6223

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/regulator/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2617,7 +2617,7 @@ static int regulator_ena_gpio_request(struct regulator_dev *rdev,
26172617
mutex_lock(&regulator_list_mutex);
26182618

26192619
list_for_each_entry(pin, &regulator_ena_gpio_list, list) {
2620-
if (pin->gpiod == gpiod) {
2620+
if (gpiod_is_equal(pin->gpiod, gpiod)) {
26212621
rdev_dbg(rdev, "GPIO is already used\n");
26222622
goto update_ena_gpio_to_rdev;
26232623
}

0 commit comments

Comments
 (0)