From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peng Fan Date: Mon, 3 Aug 2015 19:45:34 +0800 Subject: [U-Boot] [PATCH 4/4] imx: mx6ul_14x14_evk add ENET support In-Reply-To: <55BF638F.9040802@denx.de> References: <1438596380-4632-1-git-send-email-Peng.Fan@freescale.com> <1438596380-4632-4-git-send-email-Peng.Fan@freescale.com> <20150803113235.GB11842@shlinux2> <55BF638F.9040802@denx.de> Message-ID: <20150803114532.GA11906@shlinux2> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Aug 03, 2015 at 02:50:23PM +0200, Stefano Babic wrote: >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 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. > Ok. Will fix this and same piece code in other patches. Thanks, Peng. >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 >===================================================================== --