[PATCH] drm/armada: Use of_device_get_match_data()
cgel.zte at gmail.com
cgel.zte at gmail.com
Mon Feb 21 02:01:48 UTC 2022
From: Minghao Chi (CGEL ZTE) <chi.minghao at zte.com.cn>
Use of_device_get_match_data() to simplify the code.
Reported-by: Zeal Robot <zealci at zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao at zte.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
More information about the dri-devel
mailing list