Re: [RFC PATCH 01/10] mmc: core: improve API to make clear mmc_hw_reset is for cards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 21 Mar 2022 at 12:51, Wolfram Sang
<wsa+renesas@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> To make it unambiguous that mmc_hw_reset() is for cards and not for
> controllers, we a) add 'card' to the function name and b) make the
> function argument mmc_card instead of mmc_host. A fallback is provided
> until all users are converted.

In my opinion, I think b) is sufficient and would be a nice improvement.

In this regard, I suggest we make one big cross-subsystem patch (the
smallest change as possible) then I can pick it up and send it for the
v5.18-rc2.

Br
Uffe

>
> Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> ---
>  drivers/mmc/core/block.c    |  2 +-
>  drivers/mmc/core/core.c     | 18 +++++++++++++-----
>  drivers/mmc/core/mmc_test.c |  3 +--
>  include/linux/mmc/core.h    |  1 +
>  4 files changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index 4e67c1403cc9..74674a4650b0 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -993,7 +993,7 @@ static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host,
>                 return -EEXIST;
>
>         md->reset_done |= type;
> -       err = mmc_hw_reset(host);
> +       err = mmc_card_hw_reset(host->card);
>         /* Ensure we switch back to the correct partition */
>         if (err) {
>                 struct mmc_blk_data *main_md =
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 368f10405e13..71e75196bc53 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1984,7 +1984,8 @@ int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen)
>  }
>  EXPORT_SYMBOL(mmc_set_blocklen);
>
> -static void mmc_hw_reset_for_init(struct mmc_host *host)
> +/* we can't use mmc_card as a parameter, it is not populated yet */

Please drop this. The function is internal/static and at least to me,
rather self-explanatory.

[...]

Kind regards
Uffe



[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux