[U-Boot] [PATCH] omap_hsmmc: Check wp and cd GPIO for -1

Fabio Estevam festevam at gmail.com
Wed Mar 20 19:37:10 CET 2013


On Wed, Mar 20, 2013 at 3:32 PM, Tom Rini <trini at ti.com> wrote:

>         int cd_gpio = ((struct omap_hsmmc_data *)mmc->priv)->cd_gpio;
> -       return gpio_get_value(cd_gpio);
> +
> +       if (cd_gpio >= 0)

What about using gpio_is_valid(cd_gpio) ?

> +               return gpio_get_value(cd_gpio);
> +       else
> +               return -1;

What about -EINVAL?


More information about the U-Boot mailing list