This is an automated email from Gerrit. "Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8201
-- gerrit commit bb83b9e1059aee205f80e5985258f1959718e61a Author: Antonio Borneo <borneo.anto...@gmail.com> Date: Sun Apr 7 16:00:14 2024 +0200 jtag: linuxgpiod: replace gpiod_chip_open_by_number() Preparing for libgpiod v2, replace v1 specific function gpiod_chip_open_by_number() with the common v1 & v2 function gpiod_chip_open(). Change-Id: I5f0f9bef739f4097fb74f78b5b6e2fe823c1ab87 Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com> diff --git a/src/jtag/drivers/linuxgpiod.c b/src/jtag/drivers/linuxgpiod.c index 1926ed9ae6..156e9cb2f5 100644 --- a/src/jtag/drivers/linuxgpiod.c +++ b/src/jtag/drivers/linuxgpiod.c @@ -275,12 +275,15 @@ static int linuxgpiod_quit(void) static int helper_get_line(enum adapter_gpio_config_index idx) { + char chip_path[24]; + if (!is_gpio_config_valid(idx)) return ERROR_OK; int dir = GPIOD_LINE_REQUEST_DIRECTION_INPUT, flags = 0, val = 0, retval; - gpiod_chip[idx] = gpiod_chip_open_by_number(adapter_gpio_config[idx].chip_num); + snprintf(chip_path, sizeof(chip_path), "/dev/gpiochip%u", adapter_gpio_config[idx].chip_num); + gpiod_chip[idx] = gpiod_chip_open(chip_path); if (!gpiod_chip[idx]) { LOG_ERROR("Cannot open LinuxGPIOD chip %d for %s", adapter_gpio_config[idx].chip_num, adapter_gpio_get_name(idx)); --