Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: pmic-eic-sprd: Add can_sleep flag for PMIC EIC chip

The drivers uses a mutex and I2C bus access in its PMIC EIC chip
get implementation. This means these functions can sleep and the PMIC EIC
chip should set the can_sleep property to true.

This will ensure that a warning is printed when trying to get the
value from a context that potentially can't sleep.

Fixes: 348f3cde84ab ("gpio: Add Spreadtrum PMIC EIC driver support")
Signed-off-by: Wenhua Lin <Wenhua.Lin@unisoc.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Wenhua Lin and committed by
Bartosz Golaszewski
26d9e564 9e8bc2dd

+1
+1
drivers/gpio/gpio-pmic-eic-sprd.c
··· 352 352 pmic_eic->chip.set_config = sprd_pmic_eic_set_config; 353 353 pmic_eic->chip.set = sprd_pmic_eic_set; 354 354 pmic_eic->chip.get = sprd_pmic_eic_get; 355 + pmic_eic->chip.can_sleep = true; 355 356 356 357 irq = &pmic_eic->chip.irq; 357 358 gpio_irq_chip_set_chip(irq, &pmic_eic_irq_chip);