Commit 7678142f authored by Maxime Ripard's avatar Maxime Ripard

drm/vc4: crtc: Switch to of_device_get_match_data

of_device_get_match_data allow to simplify a bit the retrieval of the data
associated to the pixelvalve compatible. Let's use it.
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/1ff06413a1350d28bc3e88b034ed7ad23834e5bd.1590594512.git-series.maxime@cerno.tech
parent debf585c
...@@ -1128,10 +1128,10 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data) ...@@ -1128,10 +1128,10 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct drm_device *drm = dev_get_drvdata(master); struct drm_device *drm = dev_get_drvdata(master);
const struct vc4_crtc_data *pv_data;
struct vc4_crtc *vc4_crtc; struct vc4_crtc *vc4_crtc;
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_plane *primary_plane, *destroy_plane, *temp; struct drm_plane *primary_plane, *destroy_plane, *temp;
const struct of_device_id *match;
int ret, i; int ret, i;
vc4_crtc = devm_kzalloc(dev, sizeof(*vc4_crtc), GFP_KERNEL); vc4_crtc = devm_kzalloc(dev, sizeof(*vc4_crtc), GFP_KERNEL);
...@@ -1139,10 +1139,10 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data) ...@@ -1139,10 +1139,10 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
return -ENOMEM; return -ENOMEM;
crtc = &vc4_crtc->base; crtc = &vc4_crtc->base;
match = of_match_device(vc4_crtc_dt_match, dev); pv_data = of_device_get_match_data(dev);
if (!match) if (!pv_data)
return -ENODEV; return -ENODEV;
vc4_crtc->data = match->data; vc4_crtc->data = pv_data;
vc4_crtc->pdev = pdev; vc4_crtc->pdev = pdev;
vc4_crtc->regs = vc4_ioremap_regs(pdev, 0); vc4_crtc->regs = vc4_ioremap_regs(pdev, 0);
...@@ -1197,7 +1197,7 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data) ...@@ -1197,7 +1197,7 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
platform_set_drvdata(pdev, vc4_crtc); platform_set_drvdata(pdev, vc4_crtc);
vc4_debugfs_add_regset32(drm, vc4_crtc->data->debugfs_name, vc4_debugfs_add_regset32(drm, pv_data->debugfs_name,
&vc4_crtc->regset); &vc4_crtc->regset);
return 0; return 0;
......
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