From: joshua.clayton@uniwest.com (Joshua Clayton)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] i.MX6: WEIM: improve error handling upon child probe-failure
Date: Wed, 18 Feb 2015 08:30:33 -0800 [thread overview]
Message-ID: <5344077.NzmbySR7Uz@jclayton-pc> (raw)
In-Reply-To: <1424248641-30331-1-git-send-email-alison_chaiken@mentor.com>
Hi Alison.
I'm assuming this is a v2 of your previously posted patch.
Bear in mind I am not super familiar with refcount issues in devicetree.
There is no explicit of_node_get(), at least at this level, so the need
for the original patch is not entirely clear to me.
On Wednesday, February 18, 2015 12:37:21 AM alison at she-devel.com wrote:
> From: Alison Chaiken <alison_chaiken@mentor.com>
>
> Probe all children of the WEIM node, reporting any failures. Report
> failure from parsing of WEIM node itself if probes of all children fail.
>
> Signed-off-by: Alison Chaiken <alison_chaiken@mentor.com>
> ---
> drivers/bus/imx-weim.c | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
> index 0958b69..98e04bf 100644
> --- a/drivers/bus/imx-weim.c
> +++ b/drivers/bus/imx-weim.c
> @@ -142,7 +142,7 @@ static int __init weim_parse_dt(struct platform_device
> *pdev, &pdev->dev);
> const struct imx_weim_devtype *devtype = of_id->data;
> struct device_node *child;
> - int ret;
> + int ret, have_child;
You need to initialize have_child to 0.
>
> if (devtype == &imx50_weim_devtype) {
> ret = imx_weim_gpr_setup(pdev);
> @@ -155,20 +155,24 @@ static int __init weim_parse_dt(struct platform_device
> *pdev, continue;
>
> ret = weim_timing_setup(child, base, devtype);
> - if (ret) {
> - dev_err(&pdev->dev, "%s set timing failed.\n",
> + if (ret)
> + dev_warn(&pdev->dev, "%s set timing failed.\n",
> child->full_name);
> - return ret;
> - }
> + else
> + have_child = 1;
> }
>
> - ret = of_platform_populate(pdev->dev.of_node,
> + if (have_child)
> + ret = of_platform_populate(pdev->dev.of_node,
> of_default_bus_match_table,
> NULL, &pdev->dev);
Where did the need for of_node_put() in the original patch come from?
Is it absolved by calling platform_populate? If so, should of_node_put()
be called for each child in the !have_child case?
> - if (ret)
> + if (ret) {
> dev_err(&pdev->dev, "%s fail to create devices.\n",
> pdev->dev.of_node->full_name);
> - return ret;
> + return ret;
> + }
> +
> + return 0;
> }
This last change doesn't... err ... change. drop it.
>
> static int __init weim_probe(struct platform_device *pdev)
> --
> 2.1.4
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
Joshua Clayton
Software Engineer
UniWest
122 S. 4th Avenue
Pasco, WA 99301
Ph: (509) 544-0720
Fx: (509) 544-0868
next prev parent reply other threads:[~2015-02-18 16:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-13 17:33 [PATCH] i.MX6: WEIM: put node reference on early loop exit alison at she-devel.com
2015-02-16 5:47 ` Sascha Hauer
2015-02-17 16:28 ` Chaiken, Alison
2015-02-17 17:51 ` Joshua Clayton
2015-02-18 8:37 ` [PATCH] i.MX6: WEIM: improve error handling upon child probe-failure alison at she-devel.com
2015-02-18 16:30 ` Joshua Clayton [this message]
2015-02-19 7:19 ` [PATCH v3 0/1] " alison at she-devel.com
2015-02-19 7:24 ` [PATCH v3 1/1] " alison at she-devel.com
2015-02-23 7:17 ` Sascha Hauer
2015-03-02 13:51 ` Shawn Guo
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=5344077.NzmbySR7Uz@jclayton-pc \
--to=joshua.clayton@uniwest.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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