[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151208105331.GF22271@distanz.ch>
Date: Tue, 8 Dec 2015 11:53:31 +0100
From: Tobias Klauser <tklauser@...tanz.ch>
To: Arnd Bergmann <arnd@...db.de>
Cc: Phil Reid <preid@...ctromag.com.au>, robh+dt@...nel.org,
pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
peppe.cavallaro@...com, davem@...emloft.net,
vbridger@...nsource.altera.com, devicetree@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH v3 1/4] stmmac: create of compatible mdio bus for stmacc
driver
On 2015-12-08 at 10:35:05 +0100, Arnd Bergmann <arnd@...db.de> 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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists