From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752429AbbB0KZK (ORCPT ); Fri, 27 Feb 2015 05:25:10 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:58103 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751348AbbB0KZI (ORCPT ); Fri, 27 Feb 2015 05:25:08 -0500 Message-ID: <54F045F2.7010005@ti.com> Date: Fri, 27 Feb 2015 12:24:50 +0200 From: Roger Quadros User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Robert ABEL , , CC: , , , Subject: Re: [PATCH 2/8] ARM OMAP2+ GPMC: add bus children References: <1424961956-29353-1-git-send-email-rabel@cit-ec.uni-bielefeld.de> <1424961956-29353-3-git-send-email-rabel@cit-ec.uni-bielefeld.de> In-Reply-To: <1424961956-29353-3-git-send-email-rabel@cit-ec.uni-bielefeld.de> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robert, On 26/02/15 16:45, Robert ABEL wrote: > This patch adds support for spawning buses as children of the GPMC. > > Signed-off-by: Robert ABEL > --- > drivers/memory/omap-gpmc.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > > diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c > index 5cabac8..74a8c52 100644 > --- a/drivers/memory/omap-gpmc.c > +++ b/drivers/memory/omap-gpmc.c > @@ -27,6 +27,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -1800,8 +1801,20 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, > gpmc_cs_enable_mem(cs); > > no_timings: > - if (of_platform_device_create(child, NULL, &pdev->dev)) > - return 0; > + > + /* create platform device, NULL on error or when disabled */ > + if (!of_platform_device_create(child, NULL, &pdev->dev)) > + goto err_child_fail; > + > + /* is child a common bus? */ > + if (of_match_node(of_default_bus_match_table, child)) > + /* create children and other common bus children */ > + if (of_platform_populate(child, of_default_bus_match_table, NULL, &pdev->dev)) > + goto err_child_fail; this would print "failed to create gpmc child" but we have already created the gpmc child in the first of_platform_device_create() call. A more appropriate message would be "failed to populate all children of child->name" Also do you want to return failure? it will result in of_node_put() of the child and another print message about "probing gpmc child %s failed" in gpmc_probe_dt(). IMO if the GPMC node's child was created fine then we shouldn't return error. > + > + return 0; > + > +err_child_fail: > > dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name); > ret = -ENODEV; > cheers, -roger