Commit 89cce2b3 authored by Yu Kuai's avatar Yu Kuai Committed by Linus Walleij

pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe()

if of_find_device_by_node() succeed, pinctrl_falcon_probe() doesn't have
a corresponding put_device(). Thus add put_device() to fix the exception
handling for this function implementation.

Fixes: e316cb2b ("OF: pinctrl: MIPS: lantiq: adds support for FALCON SoC")
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20201119011219.2248232-1-yukuai3@huawei.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 43bb48c3
...@@ -431,24 +431,28 @@ static int pinctrl_falcon_probe(struct platform_device *pdev) ...@@ -431,24 +431,28 @@ static int pinctrl_falcon_probe(struct platform_device *pdev)
/* load and remap the pad resources of the different banks */ /* load and remap the pad resources of the different banks */
for_each_compatible_node(np, NULL, "lantiq,pad-falcon") { for_each_compatible_node(np, NULL, "lantiq,pad-falcon") {
struct platform_device *ppdev = of_find_device_by_node(np);
const __be32 *bank = of_get_property(np, "lantiq,bank", NULL); const __be32 *bank = of_get_property(np, "lantiq,bank", NULL);
struct resource res; struct resource res;
struct platform_device *ppdev;
u32 avail; u32 avail;
int pins; int pins;
if (!of_device_is_available(np)) if (!of_device_is_available(np))
continue; continue;
if (!ppdev) {
dev_err(&pdev->dev, "failed to find pad pdev\n");
continue;
}
if (!bank || *bank >= PORTS) if (!bank || *bank >= PORTS)
continue; continue;
if (of_address_to_resource(np, 0, &res)) if (of_address_to_resource(np, 0, &res))
continue; continue;
ppdev = of_find_device_by_node(np);
if (!ppdev) {
dev_err(&pdev->dev, "failed to find pad pdev\n");
continue;
}
falcon_info.clk[*bank] = clk_get(&ppdev->dev, NULL); falcon_info.clk[*bank] = clk_get(&ppdev->dev, NULL);
put_device(&ppdev->dev);
if (IS_ERR(falcon_info.clk[*bank])) { if (IS_ERR(falcon_info.clk[*bank])) {
dev_err(&ppdev->dev, "failed to get clock\n"); dev_err(&ppdev->dev, "failed to get clock\n");
of_node_put(np); of_node_put(np);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment