From: Heiko Stuebner <heiko@sntech.de>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
linux-pm@vger.kernel.org, linux-rockchip@lists.infradead.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Sebastian Reichel <sebastian.reichel@collabora.com>,
kernel@collabora.com
Subject: Re: [PATCH 1/7] thermal: rockchip: Simplify getting match data
Date: Tue, 15 Nov 2022 12:19:57 +0100 [thread overview]
Message-ID: <6623921.lOV4Wx5bFT@phil> (raw)
In-Reply-To: <20221031175058.175698-2-sebastian.reichel@collabora.com>
Am Montag, 31. Oktober 2022, 18:50:52 CET schrieb Sebastian Reichel:
> It's possible to directly get the match data in a generic
> way nowadays.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
> drivers/thermal/rockchip_thermal.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
> index 819e059cde71..0a0f38c29842 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -1353,16 +1353,11 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
> {
> struct device_node *np = pdev->dev.of_node;
> struct rockchip_thermal_data *thermal;
> - const struct of_device_id *match;
> struct resource *res;
> int irq;
> int i;
> int error;
>
> - match = of_match_node(of_rockchip_thermal_match, np);
> - if (!match)
> - return -ENXIO;
> -
> irq = platform_get_irq(pdev, 0);
> if (irq < 0)
> return -EINVAL;
> @@ -1374,7 +1369,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
>
> thermal->pdev = pdev;
>
> - thermal->chip = (const struct rockchip_tsadc_chip *)match->data;
> + thermal->chip = (const struct rockchip_tsadc_chip *) device_get_match_data(&pdev->dev);
Nit: This can work without the explicit cast and most users
in the kernel also use it that way - makes reading far easier.
Otherwise
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Heiko
> if (!thermal->chip)
> return -EINVAL;
>
>
next prev parent reply other threads:[~2022-11-15 11:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-31 17:50 [PATCH 0/7] RK3588 Thermal Support Sebastian Reichel
2022-10-31 17:50 ` [PATCH 1/7] thermal: rockchip: Simplify getting match data Sebastian Reichel
2022-11-15 11:19 ` Heiko Stuebner [this message]
2022-10-31 17:50 ` [PATCH 2/7] thermal: rockchip: Simplify clock logic Sebastian Reichel
2022-11-15 11:23 ` Heiko Stuebner
2022-10-31 17:50 ` [PATCH 3/7] thermal: rockchip: Use dev_err_probe Sebastian Reichel
2022-11-15 11:24 ` Heiko Stuebner
2022-10-31 17:50 ` [PATCH 4/7] thermal: rockchip: Simplify channel id logic Sebastian Reichel
2022-11-15 11:30 ` Heiko Stuebner
2022-12-06 17:02 ` Sebastian Reichel
2022-10-31 17:50 ` [PATCH 5/7] thermal: rockchip: Support dynamic sized sensor array Sebastian Reichel
2022-11-15 11:31 ` Heiko Stuebner
2022-10-31 17:50 ` [PATCH 6/7] thermal: rockchip: Support RK3588 SoC in the thermal driver Sebastian Reichel
2022-10-31 17:50 ` [PATCH 7/7] dt-bindings: rockchip-thermal: Support the RK3588 SoC compatible Sebastian Reichel
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=6623921.lOV4Wx5bFT@phil \
--to=heiko@sntech.de \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@collabora.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=rafael@kernel.org \
--cc=robh+dt@kernel.org \
--cc=rui.zhang@intel.com \
--cc=sebastian.reichel@collabora.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).