From: Roger Quadros <rogerq@ti.com>
To: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>,
balbi@ti.com, linux-omap@vger.kernel.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
tony@atomide.com, linux@arm.linux.org.uk
Subject: Re: [PATCH 2/8] ARM OMAP2+ GPMC: add bus children
Date: Fri, 27 Feb 2015 12:24:50 +0200 [thread overview]
Message-ID: <54F045F2.7010005@ti.com> (raw)
In-Reply-To: <1424961956-29353-3-git-send-email-rabel@cit-ec.uni-bielefeld.de>
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 <rabel@cit-ec.uni-bielefeld.de>
> ---
> 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 <linux/of_address.h>
> #include <linux/of_mtd.h>
> #include <linux/of_device.h>
> +#include <linux/of_platform.h>
> #include <linux/omap-gpmc.h>
> #include <linux/mtd/nand.h>
> #include <linux/pm_runtime.h>
> @@ -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
next prev parent reply other threads:[~2015-02-27 10:24 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-26 14:45 [PATCH 0/8] ARM OMAP2+ GPMC: fixes and bus children Robert ABEL
2015-02-26 14:45 ` [PATCH 1/8] ARM OMAP2+ GPMC: don't undef DEBUG Robert ABEL
2015-02-26 14:45 ` [PATCH 2/8] ARM OMAP2+ GPMC: add bus children Robert ABEL
2015-02-27 10:24 ` Roger Quadros [this message]
2015-02-27 15:08 ` Robert Abel
2015-03-03 10:09 ` Roger Quadros
2015-03-03 10:43 ` Robert Abel
2015-02-26 14:45 ` [PATCH 4/8] ARM OMAP2+ GPMC: fix debug output alignment Robert ABEL
2015-02-26 14:45 ` [PATCH 4/8] ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS Robert ABEL
2015-02-26 15:06 ` Sergei Shtylyov
2015-02-27 14:17 ` Robert Abel
2015-02-27 14:23 ` Sergei Shtylyov
2015-02-27 15:51 ` Tony Lindgren
2015-02-27 10:43 ` Roger Quadros
2015-02-27 14:05 ` Robert Abel
2015-02-26 14:45 ` [PATCH 5/8] ARM OMAP2+ GPMC: always program GPMCFCLKDIVIDER Robert ABEL
2015-02-26 14:45 ` [PATCH 6/8] ARM OMAP2+ GPMC: calculate GPMCFCLKDIVIDER based on WAITMONITORINGTIME Robert ABEL
2015-02-26 14:45 ` [PATCH 7/8] ARM OMAP2+ GPMC: fix WAITMONITORINGTIME divider bug Robert ABEL
2015-02-26 14:45 ` [PATCH 8/8] ARM OMAP2+ GPMC: fix programming/showing reserved timing parameters Robert ABEL
2015-03-03 12:53 ` [PATCH 0/8] ARM OMAP2+ GPMC: fixes and bus children Roger Quadros
2015-03-03 12:55 ` Roger Quadros
2015-03-03 12:59 ` Robert Abel
2015-03-06 0:59 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F045F2.7010005@ti.com \
--to=rogerq@ti.com \
--cc=balbi@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=rabel@cit-ec.uni-bielefeld.de \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).