From: Grant Likely <grant.likely@secretlab.ca>
To: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: netdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
magnus.damm@gmail.com, kda@linux-powerpc.org,
horms+renesas@verge.net.au
Subject: Re: [PATCHi v2] net: sh_eth: Add support of device tree probe
Date: Mon, 04 Mar 2013 16:05:09 +0800 [thread overview]
Message-ID: <20130304080509.EDF323E206B@localhost> (raw)
In-Reply-To: <511C5279.3070008@renesas.com>
On Thu, 14 Feb 2013 11:56:57 +0900, Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> wrote:
> (2013/02/14 10:24), Kuninori Morimoto wrote:
> >> +#ifdef CONFIG_OF
> >> + if (np&& of_device_is_available(np)) {
> >> + pd = sh_eth_parse_dt(&pdev->dev, ndev);
> >> + if (pdev->dev.platform_data) {
> >> + struct sh_eth_plat_data *tmp =
> >> + pdev->dev.platform_data;
> >> + pd->set_mdio_gate = tmp->set_mdio_gate;
> >> + pd->needs_init = tmp->needs_init;
> >> + }
> >> + } else
> >> +#endif
> >
> > sh_eth_parse_dt() was defined for both CONFIG_OF and !CONFIG_OF.
> > But it is called only from CONFIG_OF ?
> >
>
> Because of_device_is_available needs CONFIG_OF.
> I already send a patch which add empty function of of_device_is_available.
> If this was apply, this ifdef becomes without need.
Actually, there shouldn't be any reason for a device driver to call
of_device_is_available() on its own node at all. If the device is not
available, then a platform_device won't be created. "if (np)" here is
sufficient.
g.
next prev parent reply other threads:[~2013-03-04 8:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-14 0:51 [PATCHi v2] net: sh_eth: Add support of device tree probe Nobuhiro Iwamatsu
2013-02-14 1:24 ` Kuninori Morimoto
2013-02-14 2:56 ` Nobuhiro Iwamatsu
2013-02-22 18:49 ` Simon Horman
2013-02-27 0:39 ` Nobuhiro Iwamatsu
2013-03-04 8:05 ` Grant Likely [this message]
2013-03-04 21:37 ` Nobuhiro Iwamatsu
2013-02-14 23:07 ` Nobuhiro Iwamatsu
2013-02-14 1:47 ` Magnus Damm
2013-02-14 3:18 ` Nobuhiro Iwamatsu
2013-02-15 16:32 ` Mark Rutland
2013-03-05 0:43 ` Simon Horman
2013-03-18 0:53 ` Nobuhiro Iwamatsu
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=20130304080509.EDF323E206B@localhost \
--to=grant.likely@secretlab.ca \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=horms+renesas@verge.net.au \
--cc=kda@linux-powerpc.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=magnus.damm@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nobuhiro.iwamatsu.yj@renesas.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).