[U-Boot] [PATCH 2/5] net: fec_mxc: simplify fec_get_miibus

Joe Hershberger joe.hershberger at ni.com
Wed Mar 21 19:13:51 UTC 2018


On Tue, Mar 20, 2018 at 4:29 AM, Peng Fan <peng.fan at nxp.com> wrote:
>
>
>> -----Original Message-----
>> From: Lothar Waßmann [mailto:LW at KARO-electronics.de]
>> Sent: 2018年3月20日 16:50
>> To: Peng Fan <peng.fan at nxp.com>
>> Cc: joe.hershberger at ni.com; u-boot at lists.denx.de
>> Subject: Re: [U-Boot] [PATCH 2/5] net: fec_mxc: simplify fec_get_miibus
>>
>> Hi,
>>
>> On Sat, 10 Mar 2018 09:19:54 +0800 Peng Fan wrote:
>> > No need to provide two prototype for this function.
>> > Use ulong for the first parameter, then this function could be shared
>> > for DM/non DM case.
>> >
>> > Signed-off-by: Peng Fan <peng.fan at nxp.com>
>> > ---
>> >  drivers/net/fec_mxc.c | 13 ++-----------
>> >  include/netdev.h      |  6 +-----
>> >  2 files changed, 3 insertions(+), 16 deletions(-)
>> >
>> > diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index
>> > 7c396d8d95..2bd4ba4ef1 100644
>> > --- a/drivers/net/fec_mxc.c
>> > +++ b/drivers/net/fec_mxc.c
>> > @@ -1021,18 +1021,9 @@ static void fec_free_descs(struct fec_priv *fec)
>> >     free(fec->tbd_base);
>> >  }
>> >
>> > -#ifdef CONFIG_DM_ETH
>> > -struct mii_dev *fec_get_miibus(struct udevice *dev, int dev_id)
>> > -#else -struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id)
>> > -#endif
>> > +struct mii_dev *fec_get_miibus(ulong base_addr, int dev_id)
>> >  {
>> > -#ifdef CONFIG_DM_ETH
>> > -   struct fec_priv *priv = dev_get_priv(dev);
>> > -   struct ethernet_regs *eth = priv->eth;
>> > -#else
>> >     struct ethernet_regs *eth = (struct ethernet_regs
>> > *)(ulong)base_addr;
>> >
>> The (ulong) is redundant here.
> Thanks.
> Joe, would you mind help fix when you commit the patch,
> or you need me send out v2?

I can fix it up.

-Joe


More information about the U-Boot mailing list