All of lore.kernel.org
 help / color / mirror / Atom feed
From: cgel.zte@gmail.com
To: krzysztof.kozlowski@canonical.com
Cc: alim.akhtar@samsung.com, cgel.zte@gmail.com,
	chi.minghao@zte.com.cn, cw00.choi@samsung.com,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	mturquette@baylibre.com, s.nawrocki@samsung.com,
	sboyd@kernel.org, tomasz.figa@gmail.com, zealci@zte.com.cn
Subject: [PATCH] clk/samsung: Use of_device_get_match_data()
Date: Fri,  4 Mar 2022 01:11:55 +0000	[thread overview]
Message-ID: <20220304011155.2061393-1-chi.minghao@zte.com.cn> (raw)
In-Reply-To: <77a147f9-794c-83ca-070b-fb17d665ed8f@canonical.com>

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

Use of_device_get_match_data() to simplify the code.

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

diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c
index e6d6cbf8c4e6..feed1a347c09 100644
--- a/drivers/clk/samsung/clk-exynos-clkout.c
+++ b/drivers/clk/samsung/clk-exynos-clkout.c
@@ -81,19 +81,13 @@ 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) {
-		dev_err(dev, "cannot match parent device\n");
-		return -EINVAL;
-	}
-	variant = match->data;
+	variant = of_device_get_match_data(dev->parent);
 
 	*mux_mask = variant->mux_mask;
 
-- 
2.25.1


WARNING: multiple messages have this Message-ID
From: cgel.zte@gmail.com
To: krzysztof.kozlowski@canonical.com
Cc: alim.akhtar@samsung.com, cgel.zte@gmail.com,
	chi.minghao@zte.com.cn, cw00.choi@samsung.com,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	mturquette@baylibre.com, s.nawrocki@samsung.com,
	sboyd@kernel.org, tomasz.figa@gmail.com, zealci@zte.com.cn
Subject: [PATCH] clk/samsung: Use of_device_get_match_data()
Date: Fri,  4 Mar 2022 01:11:55 +0000	[thread overview]
Message-ID: <20220304011155.2061393-1-chi.minghao@zte.com.cn> (raw)
In-Reply-To: <77a147f9-794c-83ca-070b-fb17d665ed8f@canonical.com>

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

Use of_device_get_match_data() to simplify the code.

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

diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c
index e6d6cbf8c4e6..feed1a347c09 100644
--- a/drivers/clk/samsung/clk-exynos-clkout.c
+++ b/drivers/clk/samsung/clk-exynos-clkout.c
@@ -81,19 +81,13 @@ 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) {
-		dev_err(dev, "cannot match parent device\n");
-		return -EINVAL;
-	}
-	variant = match->data;
+	variant = of_device_get_match_data(dev->parent);
 
 	*mux_mask = variant->mux_mask;
 
-- 
2.25.1


_______________________________________________
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-04  1:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03  9:22 cgel.zte
2022-03-03  9:22 ` cgel.zte
2022-03-03  9:37 ` Krzysztof Kozlowski
2022-03-03  9:37   ` Krzysztof Kozlowski
2022-03-04  1:11   ` cgel.zte [this message]
2022-03-04  1:11     ` cgel.zte
2022-03-04  7:07     ` Krzysztof Kozlowski
2022-03-04  7:07       ` Krzysztof Kozlowski

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=20220304011155.2061393-1-chi.minghao@zte.com.cn \
    --to=cgel.zte@gmail.com \
    --cc=alim.akhtar@samsung.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=cw00.choi@samsung.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=s.nawrocki@samsung.com \
    --cc=sboyd@kernel.org \
    --cc=tomasz.figa@gmail.com \
    --cc=zealci@zte.com.cn \
    --subject='Re: [PATCH] clk/samsung: Use of_device_get_match_data()' \
    /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

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.