From: Fabio Estevam Date: Tue, 10 Oct 2017 16:43:42 +0000 (-0300) Subject: mx6slevk: Call gpio_request() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=40b0dae15159bf14f24cf7714ddd690ae3ca65e3;p=u-boot.git mx6slevk: Call gpio_request() We should call gpio_request() prior to reading the GPIO value. Signed-off-by: Fabio Estevam --- diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index 0597dbe8be..e98aa106ba 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -273,12 +273,15 @@ int board_mmc_getcd(struct mmc *mmc) switch (cfg->esdhc_base) { case USDHC1_BASE_ADDR: + gpio_request(USDHC1_CD_GPIO, "cd1_gpio"); ret = !gpio_get_value(USDHC1_CD_GPIO); break; case USDHC2_BASE_ADDR: + gpio_request(USDHC2_CD_GPIO, "cd2_gpio"); ret = !gpio_get_value(USDHC2_CD_GPIO); break; case USDHC3_BASE_ADDR: + gpio_request(USDHC3_CD_GPIO, "cd3_gpio"); ret = !gpio_get_value(USDHC3_CD_GPIO); break; }