Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i2c: Compare the return value of gpiod_get_direction against GPIO_LINE_DIRECTION_OUT

The GPIO_LINE_DIRECTION_* definitions have just recently been exposed to
gpio consumers.h by breaking them out in a separate defs.h file.

Use this to validate the gpio direction instead of the hard-coded literal.

Signed-off-by: Nikola Z. Ivanov <zlatistiv@gmail.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

authored by

Nikola Z. Ivanov and committed by
Wolfram Sang
b47bc7c0 617eb7c0

+1 -2
+1 -2
drivers/i2c/i2c-core-base.c
··· 445 445 bri->set_scl = set_scl_gpio_value; 446 446 if (bri->sda_gpiod) { 447 447 bri->get_sda = get_sda_gpio_value; 448 - /* FIXME: add proper flag instead of '0' once available */ 449 - if (gpiod_get_direction(bri->sda_gpiod) == 0) 448 + if (gpiod_get_direction(bri->sda_gpiod) == GPIO_LINE_DIRECTION_OUT) 450 449 bri->set_sda = set_sda_gpio_value; 451 450 } 452 451 } else if (bri->recover_bus == i2c_generic_scl_recovery) {