public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/4] imx: mx6ul_14x14_evk add ENET support
Date: Mon, 03 Aug 2015 14:50:23 +0200	[thread overview]
Message-ID: <55BF638F.9040802@denx.de> (raw)
In-Reply-To: <20150803113235.GB11842@shlinux2>

On 03/08/2015 13:32, Peng Fan wrote:
> Hi Fabio,
> On Mon, Aug 03, 2015 at 07:39:33AM -0300, Fabio Estevam wrote:
>> On Mon, Aug 3, 2015 at 7:06 AM, Peng Fan <Peng.Fan@freescale.com> wrote:
>>
>>> +int board_eth_init(bd_t *bis)
>>> +{
>>> +       int ret;
>>> +
>>> +       setup_iomux_fec(CONFIG_FEC_ENET_DEV);
>>> +
>>> +       ret = fecmxc_initialize_multi(bis, CONFIG_FEC_ENET_DEV,
>>> +               CONFIG_FEC_MXC_PHYADDR, IMX_FEC_BASE);
>>> +       if (ret)
>>> +               printf("FEC%d MXC: %s:failed\n", CONFIG_FEC_ENET_DEV, __func__);
>>> +
>>> +       return 0;
>>
>> You are returning 0 even if there is an error.
>>
>> You could simply do:
>>
>>       return fecmxc_initialize_multi(bis, CONFIG_FEC_ENET_DEV,
>>               CONFIG_FEC_MXC_PHYADDR, IMX_FEC_BASE);
> 
> Thanks, will fix in V2.
> 
>>
>>> +}
>>> +
>>> +static int setup_fec(int fec_id)
>>> +{
>>> +       struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
>>> +       int ret;
>>> +
>>> +       if (0 == fec_id) {
>>
>> Can you do if (!fec_id)?
> Why need to change to (!fec_id)? I do not see benifits to use (!fec_id).

No changes for the compiler, but this is like codestyle. You do not see
(maybe some exceptions ?) ( 0 == variable) in U-Boot code.

Best regards,
Stefano Babic



-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  reply	other threads:[~2015-08-03 12:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 10:06 [U-Boot] [PATCH 1/4] imx: clock support enet2 anatop clock support Peng Fan
2015-08-03 10:06 ` [U-Boot] [PATCH 2/4] net: fec: do not access reserved register for i.MX6UL Peng Fan
2015-08-05 14:31   ` Nikolay Dimitrov
2015-08-06  4:41     ` Peng Fan
2015-08-06  7:39       ` Nikolay Dimitrov
2015-08-06 13:54       ` Stefano Babic
2015-08-07  1:08         ` Peng Fan
2015-08-07  7:05           ` Stefano Babic
2015-08-03 10:06 ` [U-Boot] [PATCH 3/4] comment: net: Add CMD_MII in Kconfig Peng Fan
2015-08-11 15:59   ` Joe Hershberger
2015-08-03 10:06 ` [U-Boot] [PATCH 4/4] imx: mx6ul_14x14_evk add ENET support Peng Fan
2015-08-03 10:39   ` Fabio Estevam
2015-08-03 11:32     ` Peng Fan
2015-08-03 12:50       ` Stefano Babic [this message]
2015-08-03 11:45         ` Peng Fan
2015-08-03 10:49 ` [U-Boot] [PATCH 1/4] imx: clock support enet2 anatop clock support Fabio Estevam
2015-08-03 11:59 ` Stefano Babic
2015-08-03 11:30   ` Peng Fan

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=55BF638F.9040802@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /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