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

mfd: arizona: Fix rumtime PM imbalance on error

pm_runtime_get_sync() will increase the rumtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Dinghao Liu and committed by
Lee Jones
fe6df2b4 0b79c53e

+1 -1
+1 -1
drivers/mfd/arizona-irq.c
··· 100 100 unsigned int val; 101 101 int ret; 102 102 103 - ret = pm_runtime_get_sync(arizona->dev); 103 + ret = pm_runtime_resume_and_get(arizona->dev); 104 104 if (ret < 0) { 105 105 dev_err(arizona->dev, "Failed to resume device: %d\n", ret); 106 106 return IRQ_NONE;