[U-Boot] [PATCH] mmc: refactor two core functions

Jaehoon Chung jh80.chung at samsung.com
Fri Oct 21 06:35:03 CEST 2016


Hi,

On 10/14/2016 12:13 AM, Masahiro Yamada wrote:
> Drop unneeded variables and assignments.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>

Applied on u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung

> ---
> 
>  drivers/mmc/mmc-uclass.c | 15 ++-------------
>  1 file changed, 2 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
> index 425abb1..4e955da 100644
> --- a/drivers/mmc/mmc-uclass.c
> +++ b/drivers/mmc/mmc-uclass.c
> @@ -116,13 +116,7 @@ int get_mmc_num(void)
>  
>  int mmc_get_next_devnum(void)
>  {
> -	int ret;
> -
> -	ret = blk_find_max_devnum(IF_TYPE_MMC);
> -	if (ret < 0)
> -		return ret;
> -
> -	return ret;
> +	return blk_find_max_devnum(IF_TYPE_MMC);
>  }
>  
>  struct blk_desc *mmc_get_blk_desc(struct mmc *mmc)
> @@ -243,7 +237,6 @@ static int mmc_select_hwpart(struct udevice *bdev, int hwpart)
>  	struct udevice *mmc_dev = dev_get_parent(bdev);
>  	struct mmc *mmc = mmc_get_mmc_dev(mmc_dev);
>  	struct blk_desc *desc = dev_get_uclass_platdata(bdev);
> -	int ret;
>  
>  	if (desc->hwpart == hwpart)
>  		return 0;
> @@ -251,11 +244,7 @@ static int mmc_select_hwpart(struct udevice *bdev, int hwpart)
>  	if (mmc->part_config == MMCPART_NOAVAILABLE)
>  		return -EMEDIUMTYPE;
>  
> -	ret = mmc_switch_part(mmc, hwpart);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return mmc_switch_part(mmc, hwpart);
>  }
>  
>  static const struct blk_ops mmc_blk_ops = {
> 



More information about the U-Boot mailing list