[PATCH 12/25] drm: kirin: Reanme dc_ops to kirin_drm_data

From: John Stultz
Date: Tue Apr 23 2019 - 19:22:27 EST


From: Xu YiPing <xuyiping@xxxxxxxxxxxxx>

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: Xinliang Liu <z.liuxinliang@xxxxxxxxxxxxx>
Cc: Rongrong Zou <zourongrong@xxxxxxxxx>
Cc: Xinwei Kong <kong.kongxinwei@xxxxxxxxxxxxx>
Cc: Chen Feng <puck.chen@xxxxxxxxxxxxx>
Cc: David Airlie <airlied@xxxxxxxx>
Cc: Daniel Vetter <daniel@xxxxxxxx>
Cc: dri-devel <dri-devel@xxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Xu YiPing <xuyiping@xxxxxxxxxxxxx>
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@xxxxxxxxxx>
---
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 2 +-
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 16 ++++++++--------
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h | 4 ++--
3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
index 69604ad..221bfbb 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -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,
.cleanup = ade_drm_cleanup
};
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index c9297d6..b52c40d09 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -30,12 +30,12 @@

#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)
{
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);

return 0;
@@ -69,7 +69,7 @@ static int kirin_drm_kms_init(struct drm_device *dev)
kirin_drm_mode_config_init(dev);

/* display controller init */
- ret = dc_ops->init(to_platform_device(dev->dev));
+ ret = driver_data->init(to_platform_device(dev->dev));
if (ret)
goto err_mode_config_cleanup;

@@ -100,7 +100,7 @@ static int kirin_drm_kms_init(struct drm_device *dev)
err_unbind_all:
component_unbind_all(dev->dev, dev);
err_dc_cleanup:
- dc_ops->cleanup(to_platform_device(dev->dev));
+ driver_data->cleanup(to_platform_device(dev->dev));
err_mode_config_cleanup:
drm_mode_config_cleanup(dev);

@@ -198,8 +198,8 @@ static int kirin_drm_platform_probe(struct platform_device *pdev)
struct component_match *match = NULL;
struct device_node *remote;

- dc_ops = (struct kirin_dc_ops *)of_device_get_match_data(dev);
- if (!dc_ops) {
+ driver_data = (struct kirin_drm_data *)of_device_get_match_data(dev);
+ if (!driver_data) {
DRM_ERROR("failed to get dt id data\n");
return -EINVAL;
}
@@ -217,13 +217,13 @@ static int kirin_drm_platform_probe(struct platform_device *pdev)
static int kirin_drm_platform_remove(struct platform_device *pdev)
{
component_master_del(&pdev->dev, &kirin_drm_ops);
- dc_ops = NULL;
+ driver_data = NULL;
return 0;
}

static const struct of_device_id kirin_drm_dt_ids[] = {
{ .compatible = "hisilicon,hi6220-ade",
- .data = &ade_dc_ops,
+ .data = &ade_driver_data,
},
{ /* end node */ },
};
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
index b6626f5..276b159 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
@@ -38,11 +38,11 @@ struct kirin_plane {
};

/* display controller init/cleanup ops */
-struct kirin_dc_ops {
+struct kirin_drm_data {
int (*init)(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__ */
--
2.7.4