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>,
	kernel test robot <lkp@intel.com>
Subject: RE: [PATCH v3] mmc: host: renesas_sdhi: Refactor renesas_sdhi_probe()
Date: Wed, 21 Jul 2021 08:51:52 +0000	[thread overview]
Message-ID: <TY2PR01MB3692421AECFC48530C19A16CD8E39@TY2PR01MB3692.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CAMuHMdVH+mBWQ1KBNcrhdxoHavWpytczZmUBR_0pXu5AoULgYg@mail.gmail.com>

Hi Geert-san,


> From: Geert Uytterhoeven, Sent: Tuesday, July 20, 2021 7:35 PM
> 
> On Fri, Jul 2, 2021 at 1:31 PM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > Refactor renesas_sdhi_probe() to avoid increasing numbers of
> > sdhi_quirks_match[] entry when we add other stable SoCs like
> > r8a779m*.
> 
> Cool, then we won't need "[PATCH 04/14] mmc: renesas_sdhi: Add support
> for R-Car H3e-2G and M3e-2G".

Indeed!

> > Note that the sdhi_quirks_match[] is only needed on
> > renesas_sdhi_internal_dmac.c so that of_data of
> > renesas_sdhi_sys_dmac.c keeps as-is.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > Reported-by: kernel test robot <lkp@intel.com> # build fix on RFC
> 
> I would drop this tag, as it is basically a test/review comment for
> an older version of a patch.

I got it. I'll drop it.

> > --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> > +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> > @@ -406,15 +516,25 @@ static const struct soc_device_attribute soc_dma_quirks[] = {
> >  static int renesas_sdhi_internal_dmac_probe(struct platform_device *pdev)
> >  {
> >         const struct soc_device_attribute *soc = soc_device_match(soc_dma_quirks);
> > +       const struct soc_device_attribute *attr = soc_device_match(sdhi_quirks_match);
> > +       const struct renesas_sdhi_of_data_with_quirks *of_data_quirks;
> > +       const struct renesas_sdhi_quirks *quirks = NULL;
> >         struct device *dev = &pdev->dev;
> >
> >         if (soc)
> >                 global_flags |= (unsigned long)soc->data;
> >
> > +       of_data_quirks = of_device_get_match_data(&pdev->dev);
> > +
> > +       if (attr)
> > +               quirks = attr->data;
> > +
> 
> I think the code would be easier to read without the interleaving of
> of_device_get_match_data() and soc_device_match() based matching, ...
> 
> >         /* value is max of SD_SECCNT. Confirmed by HW engineers */
> >         dma_set_max_seg_size(dev, 0xffffffff);
> >
> > -       return renesas_sdhi_probe(pdev, &renesas_sdhi_internal_dmac_dma_ops);
> > +       return renesas_sdhi_probe(pdev, &renesas_sdhi_internal_dmac_dma_ops,
> > +                                 of_data_quirks->of_data,
> > +                                 quirks ? : of_data_quirks->quirks);
> 
> ... and without using the ternary operator, like:
> 
>     of_data_quirks = of_device_get_match_data(&pdev->dev);
>     quirks = of_data_quirks->quirks;
> 
>     attr = soc_device_match(soc_dma_quirks);
>     if (attr)
>             global_flags |= (unsigned long)attr->data;
> 
>     attr = soc_device_match(sdhi_quirks_match);
>     if (attr)
>             quirks = attr->data;
> 
>     [...]
> 
>     return renesas_sdhi_probe(pdev, &renesas_sdhi_internal_dmac_dma_ops,
>                               of_data_quirks->of_data, quirks);

Thank you for your suggestion! I'll update this patch.

> Regardless, as this doesn't impact functionality:
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thank you for your review!

Best regards,
Yoshihiro Shimoda


      reply	other threads:[~2021-07-21  9:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 11:29 [PATCH v3] mmc: host: renesas_sdhi: Refactor renesas_sdhi_probe() Yoshihiro Shimoda
2021-07-20 10:34 ` Geert Uytterhoeven
2021-07-21  8:51   ` Yoshihiro Shimoda [this message]

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=TY2PR01MB3692421AECFC48530C19A16CD8E39@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=lkp@intel.com \
    --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).