Skip to contentSkip to conversation

drm/armada: Use of_device_get_match_data()

PATCH New [email protected] 1 participant 1 message Feb 21, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/armada: Use of_device_get_match_data()

From: Minghao Chi (CGEL ZTE) <[email protected]>

Use of_device_get_match_data() to simplify the code.

---
 drivers/gpu/drm/armada/armada_crtc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/armada/armada_crtc.c +1 -6
index b7bb90ae787f..b18daef75354 100644
@@ -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);
Signature · 1 line
2.25.1