[U-Boot] [PATCH 07/18] net: macb: Convert to driver model

Simon Glass sjg at chromium.org
Thu May 5 04:38:12 CEST 2016


Hi Joe,

On 3 May 2016 at 14:54, Joe Hershberger <joe.hershberger at gmail.com> wrote:
> On Tue, May 3, 2016 at 1:40 AM, Simon Glass <sjg at chromium.org> wrote:
>> Add driver-model support to this driver. The old code remains for now so
>> that we can convert boards one at a time.
>>
>> Signed-off-by: Simon Glass <sjg at chromium.org>
>
> Acked-by: Joe Hershberger <joe.hershberger at ni.com>
>
> But with a nit...
>
>> ---
>
> <snip>
>
>> +static const struct eth_ops macb_eth_ops = {
>> +       .start  = macb_start,
>> +       .send   = macb_send,
>> +       .recv   = macb_recv,
>> +       .stop   = macb_stop,
>> +       .free_pkt       = macb_free_pkt,
>> +       .write_hwaddr   = macb_write_hwaddr,
>> +};
>> +
>> +static int macb_eth_probe(struct udevice *dev)
>> +{
>> +       struct eth_pdata *pdata = dev_get_platdata(dev);
>> +       struct macb_device *macb = dev_get_priv(dev);
>> +
>> +       macb->regs = (void *)pdata->iobase;
>> +
>> +       _macb_eth_initialize(macb);
>> +#if defined(CONFIG_CMD_MII) || defined(CONFIG_PHYLIB)
>> +       miiphy_register(dev->name, macb_miiphy_read, macb_miiphy_write);
>
> It's unfortunate that you're proliferating the oldest phy API. My
> semantic patch can come along and clean it up later as long as this is
> in before I run it again.

OK, hopefully that will work.

>
>> +       macb->bus = miiphy_get_dev_by_name(dev->name);
>> +#endif
>> +
>> +       return 0;
>> +}

Regards,
Simon


More information about the U-Boot mailing list