From: cgel.zte@gmail.com
To: s.nawrocki@samsung.com
Cc: tomasz.figa@gmail.com, cw00.choi@samsung.com,
alim.akhtar@samsung.com, mturquette@baylibre.com,
sboyd@kernel.org, krzysztof.kozlowski@canonical.com,
linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Minghao Chi <chi.minghao@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: [PATCH] clk/samsung: Use of_device_get_match_data()
Date: Thu, 3 Mar 2022 09:22:23 +0000 [thread overview]
Message-ID: <20220303092223.2060108-1-chi.minghao@zte.com.cn> (raw)
From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Use of_device_get_match_data() to simplify the code.
Reported-by: Zeal Robot <zealci@zte.com.cn>
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
next reply other threads:[~2022-03-03 9:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-03 9:22 cgel.zte [this message]
2022-03-03 9:37 ` Krzysztof Kozlowski
2022-03-04 1:11 ` cgel.zte
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=20220303092223.2060108-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 \
/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
all inboxes | Powered by JetHome®