Skip to content

Commit 13f2d25

Browse files
Haibo Chenlinusw
authored andcommitted
Revert "pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()'"
This reverts commit ba40324. After commit 26d8cde ("pinctrl: freescale: imx: add shared input select reg support"). i.MX7D has two iomux controllers iomuxc and iomuxc-lpsr which share select_input register for daisy chain settings. If use 'devm_of_iomap()', when probe the iomuxc-lpsr, will call devm_request_mem_region() for the region <0x30330000-0x3033ffff> for the first time. Then, next time when probe the iomuxc, API devm_platform_ioremap_resource() will also use the API devm_request_mem_region() for the share region <0x30330000-0x3033ffff> again, then cause issue, log like below: [ 0.179561] imx7d-pinctrl 302c0000.iomuxc-lpsr: initialized IMX pinctrl driver [ 0.191742] imx7d-pinctrl 30330000.pinctrl: can't request region for resource [mem 0x30330000-0x3033ffff] [ 0.191842] imx7d-pinctrl: probe of 30330000.pinctrl failed with error -16 Fixes: ba40324 ("pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()'") Signed-off-by: Haibo Chen <[email protected]> Reviewed-by: Dong Aisheng <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 3e5b8f8 commit 13f2d25

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/pinctrl/freescale/pinctrl-imx.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,13 +824,12 @@ int imx_pinctrl_probe(struct platform_device *pdev,
824824
return -EINVAL;
825825
}
826826

827-
ipctl->input_sel_base = devm_of_iomap(&pdev->dev, np,
828-
0, NULL);
827+
ipctl->input_sel_base = of_iomap(np, 0);
829828
of_node_put(np);
830-
if (IS_ERR(ipctl->input_sel_base)) {
829+
if (!ipctl->input_sel_base) {
831830
dev_err(&pdev->dev,
832831
"iomuxc input select base address not found\n");
833-
return PTR_ERR(ipctl->input_sel_base);
832+
return -ENOMEM;
834833
}
835834
}
836835
}

0 commit comments

Comments
 (0)