GPIO fixes for the v4.7 cycle:

- It was discovered that too many parts of the kernel does not
  respect gpiod_to_irq() returning zero for an invalid IRQ.
  While this gets fixed, we need to make it return negative
  errorcodes again.

- Harden the library a bit when passed error pointers. It is
  a bug to use these, but let's be helpful and warn the users.

- Fix an uninitialized spinlock in the 104-idi-48 driver.
gpio: make library immune to error pointers

Most functions that take a GPIO descriptor in need to check the
descriptor for IS_ERR(). We do this mostly in the VALIDATE_DESC()
macro except for the gpiod_to_irq() function which needs special
handling.

Cc: stable@vger.kernel.org
Reported-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 file changed