]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: Initialize the hardware with a callback
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 9 Oct 2019 14:34:44 +0000 (17:34 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 14 Oct 2019 23:18:46 +0000 (01:18 +0200)
commit61844a89b2a202bcd575b51625cc712e76dd41e2
tree0fd5450050bc17c4b1282918cf378df6a8a1679b
parent08b8d9ddcafc6e789a2cc14793606e0a2be1e84a
gpiolib: Initialize the hardware with a callback

After changing the drivers to use GPIO core to add an IRQ chip
it appears that some of them requires a hardware initialization
before adding the IRQ chip.

Add an optional callback ->init_hw() to allow that drivers
to initialize hardware if needed.

This change is a part of the fix NULL pointer dereference
brought to the several drivers recently.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c
include/linux/gpio/driver.h