drm: rcar-du: Don't open code of_device_get_match_data()
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sun, 16 Oct 2016 08:01:47 +0000 (10:01 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 4 Apr 2017 14:03:43 +0000 (17:03 +0300)
This change will also make Coverity happy by avoiding a theoretical NULL
pointer dereference; yet another reason is to use the above helper function
to tighten the code and make it more readable.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/gpu/drm/rcar-du/rcar_du_drv.c

index 62a3b3e32153915844f0b3371720b944c9e716bd..3a6c118457c36d5a1aca28a20e2779e572e6f3e8 100644 (file)
@@ -321,7 +321,7 @@ static int rcar_du_probe(struct platform_device *pdev)
        init_waitqueue_head(&rcdu->commit.wait);
 
        rcdu->dev = &pdev->dev;
-       rcdu->info = of_match_device(rcar_du_of_table, rcdu->dev)->data;
+       rcdu->info = of_device_get_match_data(rcdu->dev);
 
        platform_set_drvdata(pdev, rcdu);