Linux Power Management development
 help / color / mirror / Atom feed
From: Chanwoo Choi <chanwoo@kernel.org>
To: Rob Herring <robh@kernel.org>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>
Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM / devfreq: exynos-ppmu: Use device_get_match_data()
Date: Mon, 9 Oct 2023 07:29:22 +0900	[thread overview]
Message-ID: <2d9156ac-f524-4ab8-016d-c0882b0ef307@kernel.org> (raw)
In-Reply-To: <20231006213854.333261-1-robh@kernel.org>

On 23. 10. 7. 06:38, Rob Herring wrote:
> Use preferred device_get_match_data() instead of of_match_device() to
> get the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/devfreq/event/exynos-ppmu.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
> index 896a6cc93b00..56bac4702006 100644
> --- a/drivers/devfreq/event/exynos-ppmu.c
> +++ b/drivers/devfreq/event/exynos-ppmu.c
> @@ -12,9 +12,9 @@
>  #include <linux/io.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> -#include <linux/of_address.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
> +#include <linux/property.h>
>  #include <linux/regmap.h>
>  #include <linux/suspend.h>
>  #include <linux/devfreq-event.h>
> @@ -507,7 +507,6 @@ static int of_get_devfreq_events(struct device_node *np,
>  	struct device *dev = info->dev;
>  	struct device_node *events_np, *node;
>  	int i, j, count;
> -	const struct of_device_id *of_id;
>  	int ret;
>  
>  	events_np = of_get_child_by_name(np, "events");
> @@ -525,13 +524,7 @@ static int of_get_devfreq_events(struct device_node *np,
>  	}
>  	info->num_events = count;
>  
> -	of_id = of_match_device(exynos_ppmu_id_match, dev);
> -	if (of_id)
> -		info->ppmu_type = (enum exynos_ppmu_type)of_id->data;
> -	else {
> -		of_node_put(events_np);
> -		return -EINVAL;
> -	}
> +	info->ppmu_type = (enum exynos_ppmu_type)device_get_match_data(dev);
>  
>  	j = 0;
>  	for_each_child_of_node(events_np, node) {


Applied it.
Thanks.
-- 
Best Regards,
Samsung Electronics
Chanwoo Choi


      reply	other threads:[~2023-10-08 22:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 21:38 [PATCH] PM / devfreq: exynos-ppmu: Use device_get_match_data() Rob Herring
2023-10-08 22:29 ` Chanwoo Choi [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=2d9156ac-f524-4ab8-016d-c0882b0ef307@kernel.org \
    --to=chanwoo@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=robh@kernel.org \
    /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