linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
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 12:36:40 +0000	[thread overview]
Message-ID: <TY2PR01MB36925942A2FFCA2077CEEC2ED8069@TY2PR01MB3692.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CAMuHMdWmM+d2V7miepoptmaP7mmbtaWNBkJp3LqbhaiQ+18JwA@mail.gmail.com>

Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Friday, June 25, 2021 8:21 PM
> 
> On Fri, Jun 25, 2021 at 9:56 AM Yoshihiro Shimoda 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().

Thank you for your review and suggestion! I'll fix this.

Best regards,
Yoshihiro Shimoda


  reply	other threads:[~2021-06-25 12:36 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
2021-06-25 12:36   ` Yoshihiro Shimoda [this message]
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=TY2PR01MB36925942A2FFCA2077CEEC2ED8069@TY2PR01MB3692.jpnprd01.prod.outlook.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=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 \
    /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).