mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 07:35:10 +00:00
greybus: arche-platform: Put APB in reset if of_platform_populate() fails
The current implementation around of_platform_populate() is not so great. On error, we first print an error message, followed by a success message and finally we return an error. And over that we don't undo what we did initially. This patch puts the APB back into reset and create a separate error path to make things clear. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
8adf71d1b4
commit
72a8c24b6d
1 changed files with 5 additions and 2 deletions
|
@ -156,13 +156,16 @@ static int arche_platform_probe(struct platform_device *pdev)
|
|||
|
||||
/* probe all childs here */
|
||||
ret = of_platform_populate(np, NULL, NULL, dev);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
arche_platform_cleanup(arche_pdata);
|
||||
dev_err(dev, "no child node found\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
export_gpios(arche_pdata);
|
||||
|
||||
dev_info(dev, "Device registered successfully\n");
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int arche_remove_child(struct device *dev, void *unused)
|
||||
|
|
Loading…
Reference in a new issue