Commit 3726960e authored by Grygorii Strashko's avatar Grygorii Strashko Committed by Linus Walleij

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: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Acked-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 5b76e79c
...@@ -287,6 +287,9 @@ int gpiochip_add(struct gpio_chip *chip) ...@@ -287,6 +287,9 @@ int gpiochip_add(struct gpio_chip *chip)
INIT_LIST_HEAD(&chip->pin_ranges); INIT_LIST_HEAD(&chip->pin_ranges);
#endif #endif
if (!chip->owner && chip->dev && chip->dev->driver)
chip->owner = chip->dev->driver->owner;
of_gpiochip_add(chip); of_gpiochip_add(chip);
acpi_gpiochip_add(chip); acpi_gpiochip_add(chip);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment