linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/vc4: Use of_device_get_match_data()
@ 2022-02-14  2:05 cgel.zte
  2022-02-16 10:08 ` (subset) " Maxime Ripard
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-02-14  2:05 UTC (permalink / raw)
  To: emma
  Cc: mripard, airlied, daniel, dri-devel, linux-kernel,
	Minghao Chi (CGEL ZTE),
	Zeal Robot

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/gpu/drm/vc4/vc4_dsi.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
index 9300d3354c51..752f921735c6 100644
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
@@ -1493,15 +1493,10 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
 	struct drm_device *drm = dev_get_drvdata(master);
 	struct vc4_dsi *dsi = dev_get_drvdata(dev);
 	struct vc4_dsi_encoder *vc4_dsi_encoder;
-	const struct of_device_id *match;
 	dma_cap_mask_t dma_mask;
 	int ret;
 
-	match = of_match_device(vc4_dsi_dt_match, dev);
-	if (!match)
-		return -ENODEV;
-
-	dsi->variant = match->data;
+	dsi->variant = of_device_get_match_data(dev);
 
 	vc4_dsi_encoder = devm_kzalloc(dev, sizeof(*vc4_dsi_encoder),
 				       GFP_KERNEL);
-- 
2.25.1


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

* Re: (subset) [PATCH] drm/vc4: Use of_device_get_match_data()
  2022-02-14  2:05 [PATCH] drm/vc4: Use of_device_get_match_data() cgel.zte
@ 2022-02-16 10:08 ` Maxime Ripard
  0 siblings, 0 replies; 2+ messages in thread
From: Maxime Ripard @ 2022-02-16 10:08 UTC (permalink / raw)
  To: cgel.zte, emma
  Cc: Maxime Ripard, dri-devel, Zeal Robot, airlied, mripard,
	linux-kernel, Minghao Chi (CGEL ZTE),
	daniel

On Mon, 14 Feb 2022 02:05:30 +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.
> 
> 

Applied to drm/drm-misc (drm-misc-next).

Thanks!
Maxime

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

end of thread, other threads:[~2022-02-16 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14  2:05 [PATCH] drm/vc4: Use of_device_get_match_data() cgel.zte
2022-02-16 10:08 ` (subset) " 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).