linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Linux MMC List <linux-mmc@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data
Date: Fri, 25 Jun 2021 13:20:59 +0200	[thread overview]
Message-ID: <CAMuHMdWmM+d2V7miepoptmaP7mmbtaWNBkJp3LqbhaiQ+18JwA@mail.gmail.com> (raw)
In-Reply-To: <20210625075508.664674-1-yoshihiro.shimoda.uh@renesas.com>

Hi Shimoda-san,

On Fri, Jun 25, 2021 at 9:56 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> Refactor of_device_id.data to avoid increasing numbers of
> sdhi_quirks_match[] entry when we add other stable SoCs like
> r8a779m*.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Thanks for your patch!

> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -941,13 +910,8 @@ static const struct soc_device_attribute sdhi_quirks_match[]  = {
>         { .soc_id = "r8a774a1", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
>         { .soc_id = "r8a7795", .revision = "ES1.*", .data = &sdhi_quirks_4tap_nohs400 },
>         { .soc_id = "r8a7795", .revision = "ES2.0", .data = &sdhi_quirks_4tap },
> -       { .soc_id = "r8a7795", .revision = "ES3.*", .data = &sdhi_quirks_bad_taps2367 },
>         { .soc_id = "r8a7796", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
>         { .soc_id = "r8a7796", .revision = "ES1.*", .data = &sdhi_quirks_r8a7796_es13 },
> -       { .soc_id = "r8a77961", .data = &sdhi_quirks_bad_taps1357 },
> -       { .soc_id = "r8a77965", .data = &sdhi_quirks_r8a77965 },
> -       { .soc_id = "r8a77980", .data = &sdhi_quirks_nohs400 },
> -       { .soc_id = "r8a77990", .data = &sdhi_quirks_r8a77990 },
>         { /* Sentinel. */ },
>  };
>
> @@ -957,6 +921,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
>         struct tmio_mmc_data *mmd = pdev->dev.platform_data;
>         const struct renesas_sdhi_quirks *quirks = NULL;
>         const struct renesas_sdhi_of_data *of_data;
> +       const struct renesas_sdhi_of_data_with_quirks *of_data_quirks;
>         const struct soc_device_attribute *attr;
>         struct tmio_mmc_data *mmc_data;
>         struct tmio_mmc_dma *dma_priv;
> @@ -966,11 +931,14 @@ int renesas_sdhi_probe(struct platform_device *pdev,
>         struct resource *res;
>         u16 ver;
>
> -       of_data = of_device_get_match_data(&pdev->dev);
> +       of_data_quirks = of_device_get_match_data(&pdev->dev);
> +       of_data = of_data_quirks->of_data;
>
>         attr = soc_device_match(sdhi_quirks_match);
>         if (attr)
>                 quirks = attr->data;
> +       else
> +               quirks = of_data_quirks->quirks;

Please do not use "else" statements in soc_device_match()-based
quirk handling, as that makes it less trivial to remove the quirk
handling later.

I.e. move "quirks = of_data_quirks->quirks;" up, before the call
to soc_device_match().

>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>         if (!res)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2021-06-25 11:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25  7:55 [PATCH/RFC] mmc: host: renesas_sdhi: Refactor of_device_id.data Yoshihiro Shimoda
2021-06-25 11:20 ` Geert Uytterhoeven [this message]
2021-06-25 12:36   ` Yoshihiro Shimoda
2021-06-25 12:42 ` Yoshihiro Shimoda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdWmM+d2V7miepoptmaP7mmbtaWNBkJp3LqbhaiQ+18JwA@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).