drm/komeda: Constify the usage of komeda_component/pipeline/dev_funcs
authorjames qian wang (Arm Technology China) <james.qian.wang@arm.com>
Thu, 25 Apr 2019 06:12:09 +0000 (07:12 +0100)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Mon, 3 Jun 2019 11:00:30 +0000 (12:00 +0100)
Depends on:
- https://patchwork.freedesktop.org/series/58976/
- https://patchwork.freedesktop.org/series/59855/

Reported-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
drivers/gpu/drm/arm/display/komeda/komeda_dev.c
drivers/gpu/drm/arm/display/komeda/komeda_dev.h
drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c
drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h

index 031e5f3..6bab816 100644 (file)
@@ -245,7 +245,7 @@ static void d71_layer_dump(struct komeda_component *c, struct seq_file *sf)
        seq_printf(sf, "%sAD_V_CROP:\t\t0x%X\n", prefix, v[2]);
 }
 
-static struct komeda_component_funcs d71_layer_funcs = {
+static const struct komeda_component_funcs d71_layer_funcs = {
        .update         = d71_layer_update,
        .disable        = d71_layer_disable,
        .dump_register  = d71_layer_dump,
@@ -391,7 +391,7 @@ static void d71_compiz_dump(struct komeda_component *c, struct seq_file *sf)
        seq_printf(sf, "CU_USER_HIGH:\t\t0x%X\n", v[1]);
 }
 
-static struct komeda_component_funcs d71_compiz_funcs = {
+static const struct komeda_component_funcs d71_compiz_funcs = {
        .update         = d71_compiz_update,
        .disable        = d71_component_disable,
        .dump_register  = d71_compiz_dump,
@@ -467,7 +467,7 @@ static void d71_improc_dump(struct komeda_component *c, struct seq_file *sf)
                seq_printf(sf, "IPS_RGB_YUV_COEFF%u:\t0x%X\n", i, v[i]);
 }
 
-static struct komeda_component_funcs d71_improc_funcs = {
+static const struct komeda_component_funcs d71_improc_funcs = {
        .update         = d71_improc_update,
        .disable        = d71_component_disable,
        .dump_register  = d71_improc_dump,
@@ -580,7 +580,7 @@ static void d71_timing_ctrlr_dump(struct komeda_component *c,
        seq_printf(sf, "BS_USER:\t\t0x%X\n", v[4]);
 }
 
-static struct komeda_component_funcs d71_timing_ctrlr_funcs = {
+static const struct komeda_component_funcs d71_timing_ctrlr_funcs = {
        .update         = d71_timing_ctrlr_update,
        .disable        = d71_timing_ctrlr_disable,
        .dump_register  = d71_timing_ctrlr_dump,
index 34506ef..3a7248d 100644 (file)
@@ -502,7 +502,7 @@ static void d71_init_fmt_tbl(struct komeda_dev *mdev)
        table->n_formats = ARRAY_SIZE(d71_format_caps_table);
 }
 
-static struct komeda_dev_funcs d71_chip_funcs = {
+static const struct komeda_dev_funcs d71_chip_funcs = {
        .init_format_table = d71_init_fmt_tbl,
        .enum_resources = d71_enum_resources,
        .cleanup        = d71_cleanup,
@@ -514,7 +514,7 @@ static struct komeda_dev_funcs d71_chip_funcs = {
        .flush          = d71_flush,
 };
 
-struct komeda_dev_funcs *
+const struct komeda_dev_funcs *
 d71_identify(u32 __iomem *reg_base, struct komeda_chip_info *chip)
 {
        chip->arch_id   = malidp_read32(reg_base, GLB_ARCH_ID);
index 62fad59..284ce07 100644 (file)
@@ -350,7 +350,7 @@ static bool komeda_crtc_mode_fixup(struct drm_crtc *crtc,
        return true;
 }
 
-static struct drm_crtc_helper_funcs komeda_crtc_helper_funcs = {
+static const struct drm_crtc_helper_funcs komeda_crtc_helper_funcs = {
        .atomic_check   = komeda_crtc_atomic_check,
        .atomic_flush   = komeda_crtc_atomic_flush,
        .atomic_enable  = komeda_crtc_atomic_enable,
index ca3599e..d7527e1 100644 (file)
@@ -269,7 +269,7 @@ err_cleanup:
 void komeda_dev_destroy(struct komeda_dev *mdev)
 {
        struct device *dev = mdev->dev;
-       struct komeda_dev_funcs *funcs = mdev->funcs;
+       const struct komeda_dev_funcs *funcs = mdev->funcs;
        int i;
 
        sysfs_remove_group(&dev->kobj, &komeda_sysfs_attr_group);
index 29e03c4..994c6ea 100644 (file)
@@ -60,7 +60,7 @@ struct komeda_chip_info {
 
 struct komeda_product_data {
        u32 product_id;
-       struct komeda_dev_funcs *(*identify)(u32 __iomem *reg,
+       const struct komeda_dev_funcs *(*identify)(u32 __iomem *reg,
                                             struct komeda_chip_info *info);
 };
 
@@ -173,7 +173,7 @@ struct komeda_dev {
        struct komeda_pipeline *pipelines[KOMEDA_MAX_PIPELINES];
 
        /** @funcs: chip funcs to access to HW */
-       struct komeda_dev_funcs *funcs;
+       const struct komeda_dev_funcs *funcs;
        /**
         * @chip_data:
         *
@@ -192,7 +192,7 @@ komeda_product_match(struct komeda_dev *mdev, u32 target)
        return MALIDP_CORE_ID_PRODUCT_ID(mdev->chip.core_id) == target;
 }
 
-struct komeda_dev_funcs *
+const struct komeda_dev_funcs *
 d71_identify(u32 __iomem *reg, struct komeda_chip_info *chip);
 
 struct komeda_dev *komeda_dev_create(struct device *dev);
index c379439..a130b62 100644 (file)
@@ -12,7 +12,7 @@
 /** komeda_pipeline_add - Add a pipeline to &komeda_dev */
 struct komeda_pipeline *
 komeda_pipeline_add(struct komeda_dev *mdev, size_t size,
-                   struct komeda_pipeline_funcs *funcs)
+                   const struct komeda_pipeline_funcs *funcs)
 {
        struct komeda_pipeline *pipe;
 
@@ -130,7 +130,7 @@ komeda_pipeline_get_component(struct komeda_pipeline *pipe, int id)
 struct komeda_component *
 komeda_component_add(struct komeda_pipeline *pipe,
                     size_t comp_sz, u32 id, u32 hw_id,
-                    struct komeda_component_funcs *funcs,
+                    const struct komeda_component_funcs *funcs,
                     u8 max_active_inputs, u32 supported_inputs,
                     u8 max_active_outputs, u32 __iomem *reg,
                     const char *name_fmt, ...)
index b1f813a..bae8a32 100644 (file)
@@ -124,7 +124,7 @@ struct komeda_component {
        /**
         * @funcs: chip functions to access HW
         */
-       struct komeda_component_funcs *funcs;
+       const struct komeda_component_funcs *funcs;
 };
 
 /**
@@ -346,8 +346,8 @@ struct komeda_pipeline {
        struct komeda_improc *improc;
        /** @ctrlr: timing controller */
        struct komeda_timing_ctrlr *ctrlr;
-       /** @funcs: chip pipeline functions */
-       struct komeda_pipeline_funcs *funcs; /* private pipeline functions */
+       /** @funcs: chip private pipeline functions */
+       const struct komeda_pipeline_funcs *funcs;
 
        /** @of_node: pipeline dt node */
        struct device_node *of_node;
@@ -397,7 +397,7 @@ struct komeda_pipeline_state {
 /* pipeline APIs */
 struct komeda_pipeline *
 komeda_pipeline_add(struct komeda_dev *mdev, size_t size,
-                   struct komeda_pipeline_funcs *funcs);
+                   const struct komeda_pipeline_funcs *funcs);
 void komeda_pipeline_destroy(struct komeda_dev *mdev,
                             struct komeda_pipeline *pipe);
 int komeda_assemble_pipelines(struct komeda_dev *mdev);
@@ -411,7 +411,7 @@ void komeda_pipeline_dump_register(struct komeda_pipeline *pipe,
 struct komeda_component *
 komeda_component_add(struct komeda_pipeline *pipe,
                     size_t comp_sz, u32 id, u32 hw_id,
-                    struct komeda_component_funcs *funcs,
+                    const struct komeda_component_funcs *funcs,
                     u8 max_active_inputs, u32 supported_inputs,
                     u8 max_active_outputs, u32 __iomem *reg,
                     const char *name_fmt, ...);