diff options
author | Christophe JAILLET <[email protected]> | 2020-06-02 22:06:26 +0200 |
---|---|---|
committer | Linus Walleij <[email protected]> | 2020-06-03 14:35:41 +0200 |
commit | ba403242615c2c99e27af7984b1650771a2cc2c9 (patch) | |
tree | 2ff5286a10c6b634790f834d6b5949e84d22ac63 | |
parent | 11d8da5cabf7c6c3263ba2cd9c00260395867048 (diff) |
pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()'
Use 'devm_of_iomap()' instead 'of_iomap()' to avoid a resource leak in
case of error.
Update the error handling code accordingly.
Fixes: 26d8cde5260b ("pinctrl: freescale: imx: add shared input select reg support")
Suggested-by: Dan Carpenter <[email protected]>
Signed-off-by: Christophe JAILLET <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
-rw-r--r-- | drivers/pinctrl/freescale/pinctrl-imx.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 1f81569c7ae3..cb7e0f08d2cf 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -824,12 +824,13 @@ int imx_pinctrl_probe(struct platform_device *pdev, return -EINVAL; } - ipctl->input_sel_base = of_iomap(np, 0); + ipctl->input_sel_base = devm_of_iomap(&pdev->dev, np, + 0, NULL); of_node_put(np); - if (!ipctl->input_sel_base) { + if (IS_ERR(ipctl->input_sel_base)) { dev_err(&pdev->dev, "iomuxc input select base address not found\n"); - return -ENOMEM; + return PTR_ERR(ipctl->input_sel_base); } } } |