* [PATCH] clk: sunxi: use of_device_get_match_data
@ 2019-11-10 16:35 Corentin Labbe
2019-11-11 12:45 ` Maxime Ripard
0 siblings, 1 reply; 2+ messages in thread
From: Corentin Labbe @ 2019-11-10 16:35 UTC (permalink / raw)
To: emilio, mripard, mturquette, sboyd, wens
Cc: linux-arm-kernel, linux-clk, linux-kernel, linux-sunxi, Corentin Labbe
The usage of of_device_get_match_data reduce the code size a bit.
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
index a165e7172346..4c75b0770c74 100644
--- a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
+++ b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
@@ -37,7 +37,6 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct clk_onecell_data *clk_data;
- const struct of_device_id *device;
const struct gates_data *data;
const char *clk_parent;
const char *clk_name;
@@ -50,10 +49,9 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
if (!np)
return -ENODEV;
- device = of_match_device(sun6i_a31_apb0_gates_clk_dt_ids, &pdev->dev);
- if (!device)
+ data = of_device_get_match_data(&pdev->dev);
+ if (!data)
return -ENODEV;
- data = device->data;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
reg = devm_ioremap_resource(&pdev->dev, r);
--
2.23.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] clk: sunxi: use of_device_get_match_data
2019-11-10 16:35 [PATCH] clk: sunxi: use of_device_get_match_data Corentin Labbe
@ 2019-11-11 12:45 ` Maxime Ripard
0 siblings, 0 replies; 2+ messages in thread
From: Maxime Ripard @ 2019-11-11 12:45 UTC (permalink / raw)
To: Corentin Labbe
Cc: emilio, mturquette, sboyd, wens, linux-arm-kernel, linux-clk,
linux-kernel, linux-sunxi
[-- Attachment #1: Type: text/plain, Size: 220 bytes --]
On Sun, Nov 10, 2019 at 04:35:20PM +0000, Corentin Labbe wrote:
> The usage of of_device_get_match_data reduce the code size a bit.
>
> Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Queued for 5.6, thanks!
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-11 12:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-10 16:35 [PATCH] clk: sunxi: use of_device_get_match_data Corentin Labbe
2019-11-11 12:45 ` Maxime Ripard
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).