Commit 7903ba41 authored by Xu YiPing's avatar Xu YiPing Committed by Sam Ravnborg

drm: kirin: Reanme dc_ops to kirin_drm_data

As part of refactoring the kirin driver to better support
different hardware revisions, this patch renames the
struct kirin_dc_ops to struct kirin_drm_data and cleans
up the related variable names.

Cc: Rongrong Zou <zourongrong@gmail.com>
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel <dri-devel@lists.freedesktop.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: default avatarXinliang Liu <z.liuxinliang@hisilicon.com>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarXu YiPing <xuyiping@hisilicon.com>
[jstultz: reworded commit message]
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190820230626.23253-13-john.stultz@linaro.org
parent c11a03f6
...@@ -1055,7 +1055,7 @@ static void ade_drm_cleanup(struct platform_device *pdev) ...@@ -1055,7 +1055,7 @@ static void ade_drm_cleanup(struct platform_device *pdev)
{ {
} }
const struct kirin_dc_ops ade_dc_ops = { struct kirin_drm_data ade_driver_data = {
.init = ade_drm_init, .init = ade_drm_init,
.cleanup = ade_drm_cleanup .cleanup = ade_drm_cleanup
}; };
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
#include "kirin_drm_drv.h" #include "kirin_drm_drv.h"
static struct kirin_dc_ops *dc_ops; static struct kirin_drm_data *driver_data;
static int kirin_drm_kms_cleanup(struct drm_device *dev) static int kirin_drm_kms_cleanup(struct drm_device *dev)
{ {
drm_kms_helper_poll_fini(dev); drm_kms_helper_poll_fini(dev);
dc_ops->cleanup(to_platform_device(dev->dev)); driver_data->cleanup(to_platform_device(dev->dev));
drm_mode_config_cleanup(dev); drm_mode_config_cleanup(dev);
return 0; return 0;
...@@ -68,7 +68,7 @@ static int kirin_drm_kms_init(struct drm_device *dev) ...@@ -68,7 +68,7 @@ static int kirin_drm_kms_init(struct drm_device *dev)
kirin_drm_mode_config_init(dev); kirin_drm_mode_config_init(dev);
/* display controller init */ /* display controller init */
ret = dc_ops->init(to_platform_device(dev->dev)); ret = driver_data->init(to_platform_device(dev->dev));
if (ret) if (ret)
goto err_mode_config_cleanup; goto err_mode_config_cleanup;
...@@ -99,7 +99,7 @@ static int kirin_drm_kms_init(struct drm_device *dev) ...@@ -99,7 +99,7 @@ static int kirin_drm_kms_init(struct drm_device *dev)
err_unbind_all: err_unbind_all:
component_unbind_all(dev->dev, dev); component_unbind_all(dev->dev, dev);
err_dc_cleanup: err_dc_cleanup:
dc_ops->cleanup(to_platform_device(dev->dev)); driver_data->cleanup(to_platform_device(dev->dev));
err_mode_config_cleanup: err_mode_config_cleanup:
drm_mode_config_cleanup(dev); drm_mode_config_cleanup(dev);
...@@ -194,8 +194,8 @@ static int kirin_drm_platform_probe(struct platform_device *pdev) ...@@ -194,8 +194,8 @@ static int kirin_drm_platform_probe(struct platform_device *pdev)
struct component_match *match = NULL; struct component_match *match = NULL;
struct device_node *remote; struct device_node *remote;
dc_ops = (struct kirin_dc_ops *)of_device_get_match_data(dev); driver_data = (struct kirin_drm_data *)of_device_get_match_data(dev);
if (!dc_ops) { if (!driver_data) {
DRM_ERROR("failed to get dt id data\n"); DRM_ERROR("failed to get dt id data\n");
return -EINVAL; return -EINVAL;
} }
...@@ -213,13 +213,13 @@ static int kirin_drm_platform_probe(struct platform_device *pdev) ...@@ -213,13 +213,13 @@ static int kirin_drm_platform_probe(struct platform_device *pdev)
static int kirin_drm_platform_remove(struct platform_device *pdev) static int kirin_drm_platform_remove(struct platform_device *pdev)
{ {
component_master_del(&pdev->dev, &kirin_drm_ops); component_master_del(&pdev->dev, &kirin_drm_ops);
dc_ops = NULL; driver_data = NULL;
return 0; return 0;
} }
static const struct of_device_id kirin_drm_dt_ids[] = { static const struct of_device_id kirin_drm_dt_ids[] = {
{ .compatible = "hisilicon,hi6220-ade", { .compatible = "hisilicon,hi6220-ade",
.data = &ade_dc_ops, .data = &ade_driver_data,
}, },
{ /* end node */ }, { /* end node */ },
}; };
......
...@@ -34,11 +34,11 @@ struct kirin_plane { ...@@ -34,11 +34,11 @@ struct kirin_plane {
}; };
/* display controller init/cleanup ops */ /* display controller init/cleanup ops */
struct kirin_dc_ops { struct kirin_drm_data {
int (*init)(struct platform_device *pdev); int (*init)(struct platform_device *pdev);
void (*cleanup)(struct platform_device *pdev); void (*cleanup)(struct platform_device *pdev);
}; };
extern const struct kirin_dc_ops ade_dc_ops; extern struct kirin_drm_data ade_driver_data;
#endif /* __KIRIN_DRM_DRV_H__ */ #endif /* __KIRIN_DRM_DRV_H__ */
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