From: openocd-gerrit <ope...@us...> - 2025-09-27 14:54:22
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 601d478015dcbd96ce9dcde57f8004b9a13fd311 (commit) from 27ab12dd82de8154724db96b921d6b0ed650eb2d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 601d478015dcbd96ce9dcde57f8004b9a13fd311 Author: Antonio Borneo <bor...@gm...> 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 <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8201 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/jtag/drivers/linuxgpiod.c b/src/jtag/drivers/linuxgpiod.c index 36c7e0493..6f71205ca 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)); ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/linuxgpiod.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |