gpio: pmic-eic-sprd: Add can_sleep flag for PMIC EIC chip
authorWenhua Lin <Wenhua.Lin@unisoc.com>
Thu, 21 Sep 2023 12:25:27 +0000 (20:25 +0800)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 27 Sep 2023 07:12:09 +0000 (09:12 +0200)
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>
drivers/gpio/gpio-pmic-eic-sprd.c

index 2b9b7be9b8fdd892cae6a82e071795fef3d49d9e..01c0fd0a9d8c63959a0aeee445944165aaef3e5e 100644 (file)
@@ -352,6 +352,7 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev)
        pmic_eic->chip.set_config = sprd_pmic_eic_set_config;
        pmic_eic->chip.set = sprd_pmic_eic_set;
        pmic_eic->chip.get = sprd_pmic_eic_get;
+       pmic_eic->chip.can_sleep = true;
 
        irq = &pmic_eic->chip.irq;
        gpio_irq_chip_set_chip(irq, &pmic_eic_irq_chip);