[U-Boot] [PATCH 1/2] mmc: use new hwpart API when CONFIG_BLK enabled

Simon Glass sjg at chromium.org
Fri Jun 9 12:28:08 UTC 2017


On 7 June 2017 at 19:20, Kever Yang <kever.yang at rock-chips.com> wrote:
> When CONFIG_BLK is enabled, the hwpart id is different with legacy
> interface, update it to kame driver work with CONFIG_BLK.
>
> Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
> ---
>
>  cmd/mmc.c | 4 ++++
>  1 file changed, 4 insertions(+)
>

Reviewed-by: Simon Glass <sjg at chromium.org>

nit (for future) I think it is best to put the driver-model code
first, so change #iifndef to #ifdef.

> diff --git a/cmd/mmc.c b/cmd/mmc.c
> index 832eeb0..c0ff49a 100644
> --- a/cmd/mmc.c
> +++ b/cmd/mmc.c
> @@ -258,7 +258,11 @@ static int do_mmcrpmb(cmd_tbl_t *cmdtp, int flag,
>                 return CMD_RET_FAILURE;
>         }
>         /* Switch to the RPMB partition */
> +#ifndef CONFIG_BLK
>         original_part = mmc->block_dev.hwpart;
> +#else
> +       original_part = mmc_get_blk_desc(mmc)->hwpart;
> +#endif
>         if (blk_select_hwpart_devnum(IF_TYPE_MMC, curr_device, MMC_PART_RPMB) !=
>             0)
>                 return CMD_RET_FAILURE;
> --
> 1.9.1
>


More information about the U-Boot mailing list