
20 Oct
2022
20 Oct
'22
4:50 p.m.
Hello! Please look at this code from drivers/i2c/i2c-gpio.c:
static int i2c_gpio_of_to_plat(struct udevice *dev) { struct i2c_gpio_bus *bus = dev_get_priv(dev); int ret;
/* "gpios" is deprecated and replaced by "sda-gpios" + "scl-gpios". */ ret = gpio_request_list_by_name(dev, "gpios", bus->gpios, ARRAY_SIZE(bus->gpios), 0); if (ret == -ENOENT) {
The condition is always false because in gpio_request_list_by_name_nodev(), if entry is not found, this code will work: if (ret == -ENOENT) break; and then return count; return zero.