From: Tobias Klauser <tklauser-93Khv+1bN0NyDzI6CaY1VQ@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Phil Reid
<preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
pawel.moll-5wv7dgnIgG8@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
peppe.cavallaro-qxv4g6HH51o@public.gmane.org,
davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
vbridger-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3 1/4] stmmac: create of compatible mdio bus for stmacc driver
Date: Tue, 8 Dec 2015 11:53:31 +0100 [thread overview]
Message-ID: <20151208105331.GF22271@distanz.ch> (raw)
In-Reply-To: <2819989.unjINxCo2S@wuerfel>
On 2015-12-08 at 10:35:05 +0100, Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
> On Tuesday 08 December 2015 13:12:59 Phil Reid wrote:
>
> > @@ -201,6 +201,25 @@ int stmmac_mdio_register(struct net_device *ndev)
> > struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data;
> > int addr, found;
> >
> > +#ifdef CONFIG_OF
> > + struct device_node *mdio_node = NULL;
> > + struct device_node *child_node = NULL;
> > +
> > + for_each_child_of_node(priv->device->of_node, child_node) {
> > + if (of_device_is_compatible(child_node, "snps,dwmac-mdio")) {
> > + mdio_node = child_node;
> > + break;
> > + }
> > + }
>
> Can you use "if (IS_ENABLED(CONFIG_OF))" here instead of a preprocessor "#if"?
>
> > @@ -231,7 +250,11 @@ int stmmac_mdio_register(struct net_device *ndev)
> > new_bus->irq = irqlist;
> > new_bus->phy_mask = mdio_bus_data->phy_mask;
> > new_bus->parent = priv->device;
> > +#ifdef CONFIG_OF
> > + err = of_mdiobus_register(new_bus, mdio_node);
> > +#else
> > err = mdiobus_register(new_bus);
> > +#endif
>
> This looks like it should be done in the header file. Can you make
> a separate patch that changes the header file declaring of_mdiobus_register
> to make it a static inline function calling mdiobus_register() if CONFIG_OF
> is disabled?
This is already the case since commit 23a456f0 ("net: mdio:
of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF"),
so just calling of_mdiobus_register() regardless of CONFIG_OF is
sufficient here.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-12-08 10:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-08 5:12 [PATCH v3 0/4] stmmac: Fixed Phy & PTP fixes Phil Reid
2015-12-08 5:12 ` [PATCH v3 1/4] stmmac: create of compatible mdio bus for stmacc driver Phil Reid
2015-12-08 9:35 ` Arnd Bergmann
2015-12-08 10:53 ` Tobias Klauser [this message]
2015-12-08 5:13 ` [PATCH v3 2/4] stmmac: Correct documentation on stmmac clocks Phil Reid
[not found] ` <1449551582-6599-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2015-12-08 5:13 ` [PATCH v3 3/4] stmmac: Fix calculations for ptp counters when clock input = 50Mhz Phil Reid
2015-12-08 5:13 ` [PATCH v3 4/4] stmmac: socfpga: Provide dt node to config ptp clk source Phil Reid
2015-12-09 3:24 ` Rob Herring
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=20151208105331.GF22271@distanz.ch \
--to=tklauser-93khv+1bn0nydzi6cay1vq@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=peppe.cavallaro-qxv4g6HH51o@public.gmane.org \
--cc=preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=vbridger-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.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).