From: Shang XiaoJing Date: Thu, 24 Nov 2022 06:51:50 +0000 (+0800) Subject: irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe() X-Git-Tag: v6.2-rc1~195^2^2^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9ee20c85b3a3ba0afd3672630ec4f93d339f015;p=thirdparty%2Fkernel%2Flinux.git irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe() gic_probe() calls pm_runtime_get_sync() and added fail path as rpm_put to put usage_counter. However, pm_runtime_get_sync() will increment usage_counter even it failed. Fix it by replacing it with pm_runtime_resume_and_get() to keep usage counter balanced. Fixes: 9c8edddfc992 ("irqchip/gic: Add platform driver for non-root GICs that require RPM") Signed-off-by: Shang XiaoJing Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221124065150.22809-1-shangxiaojing@huawei.com --- diff --git a/drivers/irqchip/irq-gic-pm.c b/drivers/irqchip/irq-gic-pm.c index b60e1853593f4..3989d16f997b3 100644 --- a/drivers/irqchip/irq-gic-pm.c +++ b/drivers/irqchip/irq-gic-pm.c @@ -102,7 +102,7 @@ static int gic_probe(struct platform_device *pdev) pm_runtime_enable(dev); - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) goto rpm_disable;