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 <>
Signed-off-by: default avatarGrygorii Strashko <>
Acked-by: default avatarAlexandre Courbot <>
Signed-off-by: Linus Walleij's avatarLinus Walleij <>
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