From: Viresh Kumar Date: Mon, 11 Jan 2016 05:59:04 +0000 (+0530) Subject: greybus: arche-platform: Export GPIOs after populating APBs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8adf71d1b43aa1c449d22dd8e6f6c29957872a7f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Viresh Kumar Reviewed-by: Vaibhav Hiremath Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index 259473cd506d..93d90b2dc866 100644 --- a/drivers/staging/greybus/arche-platform.c +++ b/drivers/staging/greybus/arche-platform.c @@ -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; }