summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorGrygorii Strashko <grygorii.strashko@ti.com>2015-06-25 20:30:51 +0300
committerLinus Walleij <linus.walleij@linaro.org>2015-07-16 13:21:08 +0200
commit3726960edc63bb1e09678841df44b44feee20305 (patch)
treeae0f4104da908bf764a3a9a0f5423e0733974d75 /drivers/gpio/gpiolib.c
parent5b76e79c772648991e700f004205e9ac861c77c0 (diff)
gpiolib: assign chip owner to dev->driver->owner if not set
Assign GPIO chip owner field to chip->dev->driver->owner if it was not configured by GPIO driver. Cc: Johan Hovold <johan@kernel.org> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index debd7c56187d..d11f325eeea3 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -287,6 +287,9 @@ int gpiochip_add(struct gpio_chip *chip)
INIT_LIST_HEAD(&chip->pin_ranges);
#endif
+ if (!chip->owner && chip->dev && chip->dev->driver)
+ chip->owner = chip->dev->driver->owner;
+
of_gpiochip_add(chip);
acpi_gpiochip_add(chip);