Commit 9cbe89ed authored by Minghao Chi (CGEL ZTE)'s avatar Minghao Chi (CGEL ZTE) Committed by Maxime Ripard

drm/vc4: Use of_device_get_match_data()

Use of_device_get_match_data() to simplify the code.
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarMinghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220214020530.1714631-1-chi.minghao@zte.com.cn
parent 6ed19359
...@@ -1493,15 +1493,10 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) ...@@ -1493,15 +1493,10 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
struct drm_device *drm = dev_get_drvdata(master); struct drm_device *drm = dev_get_drvdata(master);
struct vc4_dsi *dsi = dev_get_drvdata(dev); struct vc4_dsi *dsi = dev_get_drvdata(dev);
struct vc4_dsi_encoder *vc4_dsi_encoder; struct vc4_dsi_encoder *vc4_dsi_encoder;
const struct of_device_id *match;
dma_cap_mask_t dma_mask; dma_cap_mask_t dma_mask;
int ret; int ret;
match = of_match_device(vc4_dsi_dt_match, dev); dsi->variant = of_device_get_match_data(dev);
if (!match)
return -ENODEV;
dsi->variant = match->data;
vc4_dsi_encoder = devm_kzalloc(dev, sizeof(*vc4_dsi_encoder), vc4_dsi_encoder = devm_kzalloc(dev, sizeof(*vc4_dsi_encoder),
GFP_KERNEL); GFP_KERNEL);
......
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