Commit c31a571d authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Linus Walleij

gpio: gpiolib: Print error number if gpio hog failed

Print the error number of GPIO hog failed during its configurations.
This helps in identifying the failure without instrumenting the code.
Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent d1279d94
...@@ -2702,15 +2702,16 @@ int gpiod_hog(struct gpio_desc *desc, const char *name, ...@@ -2702,15 +2702,16 @@ int gpiod_hog(struct gpio_desc *desc, const char *name,
local_desc = gpiochip_request_own_desc(chip, hwnum, name); local_desc = gpiochip_request_own_desc(chip, hwnum, name);
if (IS_ERR(local_desc)) { if (IS_ERR(local_desc)) {
pr_err("requesting hog GPIO %s (chip %s, offset %d) failed\n", status = PTR_ERR(local_desc);
name, chip->label, hwnum); pr_err("requesting hog GPIO %s (chip %s, offset %d) failed, %d\n",
return PTR_ERR(local_desc); name, chip->label, hwnum, status);
return status;
} }
status = gpiod_configure_flags(desc, name, dflags); status = gpiod_configure_flags(desc, name, dflags);
if (status < 0) { if (status < 0) {
pr_err("setup of hog GPIO %s (chip %s, offset %d) failed\n", pr_err("setup of hog GPIO %s (chip %s, offset %d) failed, %d\n",
name, chip->label, hwnum); name, chip->label, hwnum, status);
gpiochip_free_own_desc(desc); gpiochip_free_own_desc(desc);
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment