gpiolib: assign chip owner to dev->driver->owner if not set
authorGrygorii Strashko <grygorii.strashko@ti.com>
Thu, 25 Jun 2015 17:30:51 +0000 (20:30 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 16 Jul 2015 11:21:08 +0000 (13:21 +0200)
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>
drivers/gpio/gpiolib.c

index debd7c56187de949bb04d797070a45522ebafbbe..d11f325eeea3f3473335324769333b6d3e7914a4 100644 (file)
@@ -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);