[U-Boot] [PATCH 4/4] imx: mx6ul_14x14_evk add ENET support

Fabio Estevam
2015-08-03T10:39:33Z

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);

> +}
> +
> +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)?