From fe400dc3d57ac3b6f6b9345a9f3f4fe4d358fdaa Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Thu, 27 May 2021 15:00:18 +0200 Subject: exynos4412_gpios_data.c: get_gpio_register_offset: catch up typos faster Before, if we had a typo in a gpio bank name, we ended up with an error that looks like this: gpio_get_output_value: get_gpio_register_offset failed with error 22: Invalid argument exynos-gpio-tool: tests.c:114: test_flash_with_devmem2: Assertion `rc == GPIO_VALUE_LOW' failed. Now it looks like this: get_gpio_register_offset: could not find gpio bank data for gjp1 gpio_get_output_value: get_gpio_register_offset failed with error 22: Invalid argument This helps spot typos faster. Signed-off-by: Denis 'GNUtoo' Carikli --- exynos4412_gpios_data.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exynos4412_gpios_data.c b/exynos4412_gpios_data.c index 28c567d..d953752 100644 --- a/exynos4412_gpios_data.c +++ b/exynos4412_gpios_data.c @@ -432,12 +432,18 @@ off_t get_gpio_register_offset(int debug, char *gpio_bank_name, gpio_bank_data = get_gpio_bank_data(gpio_bank_name); if (gpio_bank_data == NULL) { + printf("%s: could not find gpio bank data for %s\n", + __func__, gpio_bank_name); + errno = EINVAL; return -1; } gpio_register_data = get_gpio_register_data(register_name); if (gpio_register_data == NULL) { + printf("%s: could not find gpio register data for %s\n", + __func__, register_name); + errno = EINVAL; return -1; } -- cgit v1.2.3