Skip to contentSkip to conversation

drm/panel: innolux-p079zca: Use of_device_get_match_data()

PATCH Applied Thierry Reding 2 participants 4 messages Jul 10, 2018

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

PATCH 1/1 drm/panel: innolux-p079zca: Use of_device_get_match_data()

From: Thierry Reding <[email protected]>

Use this helper to get rid of some extra boilerplate code.

---
 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/panel/panel-innolux-p079zca.c +1 -6
index 185a55060195..62fbaac96823 100644
@@ -314,14 +314,9 @@ static void innolux_panel_del(struct innolux_panel *innolux)
 static int innolux_panel_probe(struct mipi_dsi_device *dsi)
 {
 	const struct panel_desc *desc;
-	const struct of_device_id *id;
 	int err;
 
-	id = of_match_node(innolux_of_match, dsi->dev.of_node);
-	if (!id)
-		return -ENODEV;
-
-	desc = id->data;
+	desc = of_device_get_match_data(dsi->dev);
 	dsi->mode_flags = desc->flags;
 	dsi->format = desc->format;
 	dsi->lanes = desc->lanes;
Signature · 6 lines
2.17.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author Applied
#2 lore raw
In reply to Thierry Reding
Quoted 8 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Use this helper to get rid of some extra boilerplate code.

---
 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Applied.

Thierry

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to Thierry Reding
Quoted 19 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Use this helper to get rid of some extra boilerplate code.

---
 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/panel/panel-innolux-p079zca.c +0 -1
index 185a55060195..62fbaac96823 100644
@@ -314,14 +314,9 @@ static void innolux_panel_del(struct innolux_panel *innolux)
 static int innolux_panel_probe(struct mipi_dsi_device *dsi)
 {
 	const struct panel_desc *desc;
-	const struct of_device_id *id;
 	int err;

drivers/gpu/drm/panel/panel-innolux-p079zca.c static void innolux_panel_del(struct innolux_panel *innolux) · line 322

Quoted 10 lines
drivers/gpu/drm/panel/panel-innolux-p079zca.c +1 -5
 
-	id = of_match_node(innolux_of_match, dsi->dev.of_node);
-	if (!id)
-		return -ENODEV;
-
-	desc = id->data;
+	desc = of_device_get_match_data(dsi->dev);
 	dsi->mode_flags = desc->flags;
 	dsi->format = desc->format;
 	dsi->lanes = desc->lanes;

Oops, I just noticed I had parts of this in a stash which causes the above to fail to build. I've squashed the missing bits into the above, adding an include for linux/of_device.h and passing &dsi->dev instead of dsi->dev to of_device_get_match_data().

Thierry

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel