Commit 8adf71d1 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

greybus: arche-platform: Export GPIOs after populating APBs

Populating APBs operation can potentially fail and it would be better if
we export the GPIOs towards then end of the routine, so that we don't
need to unexport them on error cases.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 73658f2a
......@@ -154,13 +154,13 @@ static int arche_platform_probe(struct platform_device *pdev)
arche_pdata->num_apbs = of_get_child_count(np);
dev_dbg(dev, "Number of APB's available - %d\n", arche_pdata->num_apbs);
export_gpios(arche_pdata);
/* probe all childs here */
ret = of_platform_populate(np, NULL, NULL, dev);
if (ret)
dev_err(dev, "no child node found\n");
export_gpios(arche_pdata);
dev_info(dev, "Device registered successfully\n");
return ret;
}
......
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