]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/exynos: mixer: use generic of_device_get_match_data helper
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 1 Apr 2016 13:17:46 +0000 (15:17 +0200)
committerInki Dae <daeinki@gmail.com>
Sat, 30 Apr 2016 02:34:11 +0000 (11:34 +0900)
Simplify code by replacing custom code by generic helper.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_mixer.c

index d131a5a27a07382ae93fd65b050405767d24e717..d1a9944a175971939323892654a80d73bb7224b1 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/clk.h>
 #include <linux/regulator/consumer.h>
 #include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/component.h>
 
 #include <drm/exynos_drm.h>
@@ -1235,7 +1236,7 @@ static const struct component_ops mixer_component_ops = {
 static int mixer_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       struct mixer_drv_data *drv;
+       const struct mixer_drv_data *drv;
        struct mixer_context *ctx;
        int ret;
 
@@ -1245,12 +1246,7 @@ static int mixer_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
 
-       if (dev->of_node) {
-               const struct of_device_id *match;
-
-               match = of_match_node(mixer_match_types, dev->of_node);
-               drv = (struct mixer_drv_data *)match->data;
-       }
+       drv = of_device_get_match_data(dev);
 
        ctx->pdev = pdev;
        ctx->dev = dev;