linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] clk/samsung: Use of_device_get_match_data()
@ 2022-03-07  3:35 cgel.zte
  2022-03-07 12:08 ` Krzysztof Kozlowski
  2022-08-23  7:26 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 3+ messages in thread
From: cgel.zte @ 2022-03-07  3:35 UTC (permalink / raw)
  To: s.nawrocki
  Cc: tomasz.figa, cw00.choi, alim.akhtar, mturquette, sboyd,
	krzysztof.kozlowski, linux-samsung-soc, linux-clk,
	linux-arm-kernel, linux-kernel, Minghao Chi

From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>

Use of_device_get_match_data() to simplify the code.

v1->v2:
  Add a judgment for returning variant to NULL

Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
---
 drivers/clk/samsung/clk-exynos-clkout.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c
index e6d6cbf8c4e6..273f77d54dab 100644
--- a/drivers/clk/samsung/clk-exynos-clkout.c
+++ b/drivers/clk/samsung/clk-exynos-clkout.c
@@ -81,19 +81,17 @@ MODULE_DEVICE_TABLE(of, exynos_clkout_ids);
 static int exynos_clkout_match_parent_dev(struct device *dev, u32 *mux_mask)
 {
 	const struct exynos_clkout_variant *variant;
-	const struct of_device_id *match;
 
 	if (!dev->parent) {
 		dev_err(dev, "not instantiated from MFD\n");
 		return -EINVAL;
 	}
 
-	match = of_match_device(exynos_clkout_ids, dev->parent);
-	if (!match) {
+	variant = of_device_get_match_data(dev->parent);
+	if (!variant) {
 		dev_err(dev, "cannot match parent device\n");
 		return -EINVAL;
 	}
-	variant = match->data;
 
 	*mux_mask = variant->mux_mask;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] clk/samsung: Use of_device_get_match_data()
  2022-03-07  3:35 [PATCH V2] clk/samsung: Use of_device_get_match_data() cgel.zte
@ 2022-03-07 12:08 ` Krzysztof Kozlowski
  2022-08-23  7:26 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2022-03-07 12:08 UTC (permalink / raw)
  To: cgel.zte, s.nawrocki
  Cc: tomasz.figa, cw00.choi, alim.akhtar, mturquette, sboyd,
	linux-samsung-soc, linux-clk, linux-arm-kernel, linux-kernel,
	Minghao Chi

On 07/03/2022 04:35, cgel.zte@gmail.com wrote:
> From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
> 
> Use of_device_get_match_data() to simplify the code.
> 
> v1->v2:
>   Add a judgment for returning variant to NULL

Changelog goes after ---, not inside the commit message.

With commit fix above:
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] clk/samsung: Use of_device_get_match_data()
  2022-03-07  3:35 [PATCH V2] clk/samsung: Use of_device_get_match_data() cgel.zte
  2022-03-07 12:08 ` Krzysztof Kozlowski
@ 2022-08-23  7:26 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-23  7:26 UTC (permalink / raw)
  To: cgel.zte, s.nawrocki
  Cc: linux-kernel, Krzysztof Kozlowski, chi.minghao,
	Krzysztof Kozlowski, cw00.choi, linux-samsung-soc, mturquette,
	sboyd, linux-arm-kernel, alim.akhtar, linux-clk, tomasz.figa

On Mon, 7 Mar 2022 03:35:46 +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
> 
> Use of_device_get_match_data() to simplify the code.
> 
> v1->v2:
>   Add a judgment for returning variant to NULL
> 
> [...]

Applied, thanks!

[1/1] clk/samsung: Use of_device_get_match_data()
      https://git.kernel.org/krzk/linux/c/777aaf3d1daf793461269b49c063aca1cee06a44

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-23  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07  3:35 [PATCH V2] clk/samsung: Use of_device_get_match_data() cgel.zte
2022-03-07 12:08 ` Krzysztof Kozlowski
2022-08-23  7:26 ` Krzysztof Kozlowski

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).