Commit f295df17 authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Inki Dae

drm/exynos: rotator: use generic of_device_get_match_data helper

Simplify code by replacing custom code by generic helper.
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent e1a7b9b4
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/of_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <drm/drmP.h> #include <drm/drmP.h>
...@@ -696,7 +697,6 @@ static int rotator_probe(struct platform_device *pdev) ...@@ -696,7 +697,6 @@ static int rotator_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct rot_context *rot; struct rot_context *rot;
struct exynos_drm_ippdrv *ippdrv; struct exynos_drm_ippdrv *ippdrv;
const struct of_device_id *match;
int ret; int ret;
if (!dev->of_node) { if (!dev->of_node) {
...@@ -708,13 +708,8 @@ static int rotator_probe(struct platform_device *pdev) ...@@ -708,13 +708,8 @@ static int rotator_probe(struct platform_device *pdev)
if (!rot) if (!rot)
return -ENOMEM; return -ENOMEM;
match = of_match_node(exynos_rotator_match, dev->of_node); rot->limit_tbl = (struct rot_limit_table *)
if (!match) { of_device_get_match_data(dev);
dev_err(dev, "failed to match node\n");
return -ENODEV;
}
rot->limit_tbl = (struct rot_limit_table *)match->data;
rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
rot->regs = devm_ioremap_resource(dev, rot->regs_res); rot->regs = devm_ioremap_resource(dev, rot->regs_res);
if (IS_ERR(rot->regs)) if (IS_ERR(rot->regs))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment