From: Sebastian Reichel <sebastian.reichel@collabora.com> To: Heiko Stuebner <heiko@sntech.de>, "Rafael J. Wysocki" <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.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: [PATCHv3 1/7] thermal: rockchip: Simplify getting match data Date: Thu, 5 Jan 2023 19:03:34 +0100 [thread overview] Message-ID: <20230105180340.29140-2-sebastian.reichel@collabora.com> (raw) In-Reply-To: <20230105180340.29140-1-sebastian.reichel@collabora.com> It's possible to directly get the match data in a generic way nowadays. Reviewed-by: Heiko Stuebner <heiko@sntech.de> 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..8c52700d58e8 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 = device_get_match_data(&pdev->dev); if (!thermal->chip) return -EINVAL; -- 2.39.0
WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Reichel <sebastian.reichel@collabora.com> To: Heiko Stuebner <heiko@sntech.de>, "Rafael J. Wysocki" <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.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: [PATCHv3 1/7] thermal: rockchip: Simplify getting match data Date: Thu, 5 Jan 2023 19:03:34 +0100 [thread overview] Message-ID: <20230105180340.29140-2-sebastian.reichel@collabora.com> (raw) In-Reply-To: <20230105180340.29140-1-sebastian.reichel@collabora.com> It's possible to directly get the match data in a generic way nowadays. Reviewed-by: Heiko Stuebner <heiko@sntech.de> 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..8c52700d58e8 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 = device_get_match_data(&pdev->dev); if (!thermal->chip) return -EINVAL; -- 2.39.0 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2023-01-05 18:04 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-05 18:03 [PATCHv3 0/7] RK3588 Thermal Support Sebastian Reichel 2023-01-05 18:03 ` Sebastian Reichel 2023-01-05 18:03 ` Sebastian Reichel [this message] 2023-01-05 18:03 ` [PATCHv3 1/7] thermal: rockchip: Simplify getting match data Sebastian Reichel 2023-01-05 18:03 ` [PATCHv3 2/7] thermal: rockchip: Simplify clock logic Sebastian Reichel 2023-01-05 18:03 ` Sebastian Reichel 2023-01-05 18:03 ` [PATCHv3 3/7] thermal: rockchip: Use dev_err_probe Sebastian Reichel 2023-01-05 18:03 ` Sebastian Reichel 2023-01-05 18:03 ` [PATCHv3 4/7] thermal: rockchip: Simplify channel id logic Sebastian Reichel 2023-01-05 18:03 ` Sebastian Reichel 2023-01-05 18:03 ` [PATCHv3 5/7] thermal: rockchip: Support dynamic sized sensor array Sebastian Reichel 2023-01-05 18:03 ` Sebastian Reichel 2023-01-05 18:03 ` [PATCHv3 6/7] thermal: rockchip: Support RK3588 SoC in the thermal driver Sebastian Reichel 2023-01-05 18:03 ` Sebastian Reichel 2023-01-05 18:03 ` [PATCHv3 7/7] dt-bindings: rockchip-thermal: Support the RK3588 SoC compatible Sebastian Reichel 2023-01-05 18:03 ` 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=20230105180340.29140-2-sebastian.reichel@collabora.com \ --to=sebastian.reichel@collabora.com \ --cc=amitk@kernel.org \ --cc=daniel.lezcano@linaro.org \ --cc=devicetree@vger.kernel.org \ --cc=heiko@sntech.de \ --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 \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.