Skip to content

Commit

Permalink
gpio: improve error reporting on own descriptors
Browse files Browse the repository at this point in the history
When requesting own descriptors through hogs, it is useful to
get some details about what's going on if we encounter problems.

Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Linus Walleij committed Jun 10, 2015
1 parent 8405f20 commit a713890
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2131,13 +2131,15 @@ int gpiod_hog(struct gpio_desc *desc, const char *name,

local_desc = gpiochip_request_own_desc(chip, hwnum, name);
if (IS_ERR(local_desc)) {
pr_err("requesting own GPIO %s failed\n", name);
pr_err("requesting hog GPIO %s (chip %s, offset %d) failed\n",
name, chip->label, hwnum);
return PTR_ERR(local_desc);
}

status = gpiod_configure_flags(desc, name, lflags, dflags);
if (status < 0) {
pr_err("setup of GPIO %s failed\n", name);
pr_err("setup of hog GPIO %s (chip %s, offset %d) failed\n",
name, chip->label, hwnum);
gpiochip_free_own_desc(desc);
return status;
}
Expand Down

0 comments on commit a713890

Please sign in to comment.