[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220221020148.1925091-1-chi.minghao@zte.com.cn>
Date: Mon, 21 Feb 2022 02:01:48 +0000
From: cgel.zte@...il.com
To: linux@...linux.org.uk
Cc: airlied@...ux.ie, daniel@...ll.ch, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] drm/armada: Use of_device_get_match_data()
From: Minghao Chi (CGEL ZTE) <chi.minghao@....com.cn>
Use of_device_get_match_data() to simplify the code.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@....com.cn>
---
drivers/gpu/drm/armada/armada_crtc.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
index b7bb90ae787f..b18daef75354 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -1026,13 +1026,8 @@ armada_lcd_bind(struct device *dev, struct device *master, void *data)
variant = (const struct armada_variant *)id->driver_data;
} else {
- const struct of_device_id *match;
struct device_node *np, *parent = dev->of_node;
- match = of_match_device(dev->driver->of_match_table, dev);
- if (!match)
- return -ENXIO;
-
np = of_get_child_by_name(parent, "ports");
if (np)
parent = np;
@@ -1043,7 +1038,7 @@ armada_lcd_bind(struct device *dev, struct device *master, void *data)
return -ENXIO;
}
- variant = match->data;
+ variant = of_device_get_match_data(dev);
}
return armada_drm_crtc_create(drm, dev, res, irq, variant, port);
--
2.25.1
Powered by blists - more mailing lists