]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
gpio: improve error reporting on own descriptors
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 5 Jun 2015 09:36:10 +0000 (11:36 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 10 Jun 2015 08:15:46 +0000 (10:15 +0200)
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>
drivers/gpio/gpiolib.c

index 07b83a9e982131bd96403a1acf3a14b9f691275c..7f87b9baa90547eda034ee6fddc75493ae1e97d8 100644 (file)
@@ -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;
        }