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

Fabio Estevam
2014-05-07T18:22:33Z

On Wed, May 7, 2014 at 3:19 PM, Stephen Warren <swarren@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?