[U-Boot] [PATCH 1/3] mx6qsabresd: Fix card detection for invalid card id case

Otavio Salvador otavio at ossystems.com.br
Sun Mar 3 00:22:24 CET 2013


On Sat, Mar 2, 2013 at 8:19 PM, Otavio Salvador <otavio at ossystems.com.br> wrote:
> On Sat, Mar 2, 2013 at 8:15 PM, Fabio Estevam <festevam at gmail.com> wrote:
>> On Sat, Mar 2, 2013 at 8:08 PM, Otavio Salvador <otavio at ossystems.com.br> wrote:
>>
>>>>>         }
>>>>> +
>>>>> +       return 0;
>>>>
>>>> ,but why do we need this?
>>>
>>> Fail by default?
>>
>> No, just do like mx53loco and mx6qsabrelite, where we always 'return ret'
>
> Ok; will fix it

Well, we don't have ret here.

int board_mmc_getcd(struct mmc *mmc)
{
    struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;

    switch (cfg->esdhc_base) {
    case USDHC2_BASE_ADDR:
        return !gpio_get_value(USDHC2_CD_GPIO);
    case USDHC3_BASE_ADDR:
        return !gpio_get_value(USDHC3_CD_GPIO);
    case USDHC4_BASE_ADDR:
        return 1; /* eMMC/uSDHC4 is always present */
    }

    return 0;
}

So I think the default ought to be 0;

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br


More information about the U-Boot mailing list