Skip to content

Commit

Permalink
gpiolib: assign chip owner to dev->driver->owner if not set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Grygorii Strashko authored and Linus Walleij committed Jul 16, 2015
1 parent 5b76e79 commit 3726960
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3726960

Please sign in to comment.