From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: netdev@vger.kernel.org, horms+renesas@verge.net.au,
magnus.damm@gmail.com, devicetree-discuss@lists.ozlabs.org,
kda@linux-powerpc.org
Subject: Re: [PATCHi v2] net: sh_eth: Add support of device tree probe
Date: Thu, 14 Feb 2013 11:56:57 +0900 [thread overview]
Message-ID: <511C5279.3070008@renesas.com> (raw)
In-Reply-To: <87mwv7ofgj.wl%kuninori.morimoto.gx@renesas.com>
(2013/02/14 10:24), Kuninori Morimoto wrote:
>
> Hi Iwamatsu-san
>
> Thank you for this patch.
>
> Small comment from me
>
>> +#ifdef CONFIG_OF
> (snip)
>> +sh_eth_parse_dt(struct device *dev, struct net_device *ndev)
>> +{
>> + int ret;
>> + struct device_node *np = dev->of_node;
>> + struct sh_eth_plat_data *pdata;
> ...
>> +#else
>> +static struct sh_eth_plat_data *
>> +sh_eth_parse_dt(struct device *dev, struct net_device *ndev)
>> +{
>> + return NULL;
>> +}
>> +#endif
>
> (snip)
>
>> static int sh_eth_drv_probe(struct platform_device *pdev)
>> {
> ...
>> +#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.
Best,
Nobuhiro
next prev parent reply other threads:[~2013-02-15 0:41 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 [this message]
2013-02-22 18:49 ` Simon Horman
2013-02-27 0:39 ` Nobuhiro Iwamatsu
2013-03-04 8:05 ` Grant Likely
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=511C5279.3070008@renesas.com \
--to=nobuhiro.iwamatsu.yj@renesas.com \
--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 \
/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).