* [U-Boot] [PATCH 1/2] mx6sabresd: Fix error handling in board_mmc_init() @ 2014-11-06 14:24 Fabio Estevam 2014-11-06 14:24 ` [U-Boot] [PATCH 2/2] mx6sabresd: Staticize when possible Fabio Estevam 2014-11-13 17:03 ` [U-Boot] [PATCH 1/2] mx6sabresd: Fix error handling in board_mmc_init() Stefano Babic 0 siblings, 2 replies; 4+ messages in thread From: Fabio Estevam @ 2014-11-06 14:24 UTC (permalink / raw) To: u-boot When an invalid USDHC port is passed we should return -EINVAL instead of 0. Also, return the error immediately on fsl_esdhc_initialize() failure. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> --- board/freescale/mx6sabresd/mx6sabresd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index 3d81fff..e221981 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -253,7 +253,7 @@ int board_mmc_getcd(struct mmc *mmc) int board_mmc_init(bd_t *bis) { - s32 status = 0; + int ret; int i; /* @@ -286,13 +286,15 @@ int board_mmc_init(bd_t *bis) printf("Warning: you configured more USDHC controllers" "(%d) then supported by the board (%d)\n", i + 1, CONFIG_SYS_FSL_USDHC_NUM); - return status; + return -EINVAL; } - status |= fsl_esdhc_initialize(bis, &usdhc_cfg[i]); + ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]); + if (ret) + return ret; } - return status; + return 0; } #endif -- 1.9.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH 2/2] mx6sabresd: Staticize when possible 2014-11-06 14:24 [U-Boot] [PATCH 1/2] mx6sabresd: Fix error handling in board_mmc_init() Fabio Estevam @ 2014-11-06 14:24 ` Fabio Estevam 2014-11-13 17:03 ` Stefano Babic 2014-11-13 17:03 ` [U-Boot] [PATCH 1/2] mx6sabresd: Fix error handling in board_mmc_init() Stefano Babic 1 sibling, 1 reply; 4+ messages in thread From: Fabio Estevam @ 2014-11-06 14:24 UTC (permalink / raw) To: u-boot Annotate 'static' when appropriate for the variables used locally. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> --- board/freescale/mx6sabresd/mx6sabresd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index e221981..8e2bc25 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -60,12 +60,12 @@ int dram_init(void) return 0; } -iomux_v3_cfg_t const uart1_pads[] = { +static iomux_v3_cfg_t const uart1_pads[] = { MX6_PAD_CSI0_DAT10__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), MX6_PAD_CSI0_DAT11__UART1_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), }; -iomux_v3_cfg_t const enet_pads[] = { +static iomux_v3_cfg_t const enet_pads[] = { MX6_PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL), MX6_PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL), MX6_PAD_RGMII_TXC__RGMII_TXC | MUX_PAD_CTRL(ENET_PAD_CTRL), @@ -95,7 +95,7 @@ static void setup_iomux_enet(void) gpio_set_value(IMX_GPIO_NR(1, 25), 1); } -iomux_v3_cfg_t const usdhc2_pads[] = { +static iomux_v3_cfg_t const usdhc2_pads[] = { MX6_PAD_SD2_CLK__SD2_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD2_CMD__SD2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD2_DAT0__SD2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), @@ -109,7 +109,7 @@ iomux_v3_cfg_t const usdhc2_pads[] = { MX6_PAD_NANDF_D2__GPIO2_IO02 | MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */ }; -iomux_v3_cfg_t const usdhc3_pads[] = { +static iomux_v3_cfg_t const usdhc3_pads[] = { MX6_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), @@ -123,7 +123,7 @@ iomux_v3_cfg_t const usdhc3_pads[] = { MX6_PAD_NANDF_D0__GPIO2_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */ }; -iomux_v3_cfg_t const usdhc4_pads[] = { +static iomux_v3_cfg_t const usdhc4_pads[] = { MX6_PAD_SD4_CLK__SD4_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD4_CMD__SD4_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD4_DAT0__SD4_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), @@ -136,7 +136,7 @@ iomux_v3_cfg_t const usdhc4_pads[] = { MX6_PAD_SD4_DAT7__SD4_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), }; -iomux_v3_cfg_t const ecspi1_pads[] = { +static iomux_v3_cfg_t const ecspi1_pads[] = { MX6_PAD_KEY_COL0__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL), MX6_PAD_KEY_COL1__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL), MX6_PAD_KEY_ROW0__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL), -- 1.9.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH 2/2] mx6sabresd: Staticize when possible 2014-11-06 14:24 ` [U-Boot] [PATCH 2/2] mx6sabresd: Staticize when possible Fabio Estevam @ 2014-11-13 17:03 ` Stefano Babic 0 siblings, 0 replies; 4+ messages in thread From: Stefano Babic @ 2014-11-13 17:03 UTC (permalink / raw) To: u-boot On 06/11/2014 15:24, Fabio Estevam wrote: > Annotate 'static' when appropriate for the variables used locally. > > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> > --- Applied to -u-boot-imx, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel 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 ===================================================================== ^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH 1/2] mx6sabresd: Fix error handling in board_mmc_init() 2014-11-06 14:24 [U-Boot] [PATCH 1/2] mx6sabresd: Fix error handling in board_mmc_init() Fabio Estevam 2014-11-06 14:24 ` [U-Boot] [PATCH 2/2] mx6sabresd: Staticize when possible Fabio Estevam @ 2014-11-13 17:03 ` Stefano Babic 1 sibling, 0 replies; 4+ messages in thread From: Stefano Babic @ 2014-11-13 17:03 UTC (permalink / raw) To: u-boot On 06/11/2014 15:24, Fabio Estevam wrote: > When an invalid USDHC port is passed we should return -EINVAL instead of 0. > > Also, return the error immediately on fsl_esdhc_initialize() failure. > > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> > --- Applied to -u-boot-imx, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel 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 ===================================================================== ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-11-13 17:03 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-11-06 14:24 [U-Boot] [PATCH 1/2] mx6sabresd: Fix error handling in board_mmc_init() Fabio Estevam 2014-11-06 14:24 ` [U-Boot] [PATCH 2/2] mx6sabresd: Staticize when possible Fabio Estevam 2014-11-13 17:03 ` Stefano Babic 2014-11-13 17:03 ` [U-Boot] [PATCH 1/2] mx6sabresd: Fix error handling in board_mmc_init() Stefano Babic
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox