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?

        Arnd
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to