]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2023 12:56:50 +0000 (14:56 +0200)
[ Upstream commit 26d9e5640d2130ee16df7b1fb6a908f460ab004c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-pmic-eic-sprd.c

index e518490c4b681afa6f979f9e8a5ce5a964aa71e1..ebbbcb54270d16c7bb0ba1960c980d21193a3d1f 100644 (file)
@@ -337,6 +337,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;
 
        pmic_eic->intc.name = dev_name(&pdev->dev);
        pmic_eic->intc.irq_mask = sprd_pmic_eic_irq_mask;