Skip to content

Commit 3ada713

Browse files
Zhang Qilongmiquelraynal
authored andcommitted
mtd: rawnand: tegra: Fix PM disable depth imbalance in probe
The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. Cc: [email protected] Fixes: d7d9f8e ("mtd: rawnand: add NVIDIA Tegra NAND Flash controller driver") Signed-off-by: Zhang Qilong <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 1f3b494 commit 3ada713

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mtd/nand/raw/tegra_nand.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ static int tegra_nand_probe(struct platform_device *pdev)
11811181
pm_runtime_enable(&pdev->dev);
11821182
err = pm_runtime_resume_and_get(&pdev->dev);
11831183
if (err)
1184-
return err;
1184+
goto err_dis_pm;
11851185

11861186
err = reset_control_reset(rst);
11871187
if (err) {
@@ -1215,6 +1215,8 @@ static int tegra_nand_probe(struct platform_device *pdev)
12151215
err_put_pm:
12161216
pm_runtime_put_sync_suspend(ctrl->dev);
12171217
pm_runtime_force_suspend(ctrl->dev);
1218+
err_dis_pm:
1219+
pm_runtime_disable(&pdev->dev);
12181220
return err;
12191221
}
12201222

0 commit comments

Comments
 (0)