linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: cgel.zte@gmail.com, mturquette@baylibre.com
Cc: heiko@sntech.de, linux-clk@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	Minghao Chi <chi.minghao@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] clk/rockchip: Use of_device_get_match_data()
Date: Wed, 09 Mar 2022 10:57:36 -0800	[thread overview]
Message-ID: <20220309185738.2192EC340EC@smtp.kernel.org> (raw)
In-Reply-To: <20220304011703.2061466-1-chi.minghao@zte.com.cn>

Quoting cgel.zte@gmail.com (2022-03-03 17:17:03)
> From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
> 
> Use of_device_get_match_data() to simplify the code.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
> ---
>  drivers/clk/rockchip/clk-rk3399.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c
> index 306910a3a0d3..b1b67bfb63b8 100644
> --- a/drivers/clk/rockchip/clk-rk3399.c
> +++ b/drivers/clk/rockchip/clk-rk3399.c
> @@ -1634,14 +1634,8 @@ static const struct of_device_id clk_rk3399_match_table[] = {
>  static int __init clk_rk3399_probe(struct platform_device *pdev)
>  {
>         struct device_node *np = pdev->dev.of_node;
> -       const struct of_device_id *match;
>         const struct clk_rk3399_inits *init_data;
> -
> -       match = of_match_device(clk_rk3399_match_table, &pdev->dev);
> -       if (!match || !match->data)
> -               return -EINVAL;
> -
> -       init_data = match->data;
> +       init_data = of_device_get_match_data(&pdev->dev);

The translation doesn't look equivalent. Before we would bail out of
probe if match data isn't there with an error. That isn't possible of
course with further investigation but please make a note of this in the
commit text to aid review. Also, please don't send new versions of
patches in reply to previous versions of patches. It breaks my patch
workflow. Thanks in advance.

>         if (init_data->inits)
>                 init_data->inits(np);
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-03-09 18:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04  1:17 [PATCH] clk/rockchip: Use of_device_get_match_data() cgel.zte
2022-03-09 18:57 ` Stephen Boyd [this message]
2022-03-10 16:22   ` Heiko Stübner
  -- strict thread matches above, loose matches on Subject: below --
2022-02-21  2:01 cgel.zte
2022-02-23 23:44 ` Heiko Stuebner

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=20220309185738.2192EC340EC@smtp.kernel.org \
    --to=sboyd@kernel.org \
    --cc=cgel.zte@gmail.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=zealci@zte.com.cn \
    /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).