[PATCH] drm/armada: Use of_device_get_match_data()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Minghao Chi (CGEL ZTE) <chi.minghao@xxxxxxxxxx>

Use of_device_get_match_data() to simplify the code.

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@xxxxxxxxxx>
---
 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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux