[U-Boot] [PATCH 3/4] mmc: provide a select_hwpart implementation for get_device()

Fabio Estevam festevam at gmail.com
Wed May 7 20:22:33 CEST 2014


On Wed, May 7, 2014 at 3:19 PM, Stephen Warren <swarren at wwwdotorg.org> wrote:

> +int mmc_select_hwpart(int dev_num, int hwpart)
> +{
> +       struct mmc *mmc = find_mmc_device(dev_num);
> +       int ret;
> +
> +       if (!mmc)
> +               return -1;
> +
> +       if (mmc->part_num == hwpart)
> +               return 0;
> +
> +       if (mmc->part_config == MMCPART_NOAVAILABLE) {
> +               printf("Card doesn't support part_switch\n");
> +               return -1;
> +       }
> +
> +       ret = mmc_switch_part(dev_num, hwpart);
> +       if (ret)
> +               return -1;

Can't you return more appropriate return values rather than -1?


More information about the U-Boot mailing list