media: atomisp: Remove atomisp_sw_contex struct
authorHans de Goede <hdegoede@redhat.com>
Mon, 21 Nov 2022 14:06:09 +0000 (15:06 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Wed, 8 Feb 2023 06:57:40 +0000 (07:57 +0100)
Remove the atomisp_sw_contex struct, it has only 1 member: running_freq,
instead store running_freq directly.

While at it also change running_freq from an int to an unsigned int,
all values stored in it are unsigned and it is compared to the also
unsigned new_freq variable.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_cmd.c
drivers/staging/media/atomisp/pci/atomisp_fops.c
drivers/staging/media/atomisp/pci/atomisp_internal.h

index e798fa7..33accdf 100644 (file)
@@ -280,14 +280,14 @@ int atomisp_freq_scaling(struct atomisp_device *isp,
 done:
        dev_dbg(isp->dev, "DFS target frequency=%d.\n", new_freq);
 
-       if ((new_freq == isp->sw_contex.running_freq) && !force)
+       if ((new_freq == isp->running_freq) && !force)
                return 0;
 
        dev_dbg(isp->dev, "Programming DFS frequency to %d\n", new_freq);
 
        ret = write_target_freq_to_hw(isp, new_freq);
        if (!ret) {
-               isp->sw_contex.running_freq = new_freq;
+               isp->running_freq = new_freq;
                trace_ipu_pstate(new_freq, -1);
        }
        return ret;
index ccdd780..8d5522b 100644 (file)
@@ -681,7 +681,7 @@ static void atomisp_dev_init_struct(struct atomisp_device *isp)
         * For Merrifield, frequency is scalable.
         * After boot-up, the default frequency is 200MHz.
         */
-       isp->sw_contex.running_freq = ISP_FREQ_200MHZ;
+       isp->running_freq = ISP_FREQ_200MHZ;
 }
 
 static void atomisp_subdev_init_struct(struct atomisp_sub_device *asd)
index 653e6d7..675007d 100644 (file)
@@ -194,10 +194,6 @@ struct atomisp_regs {
        u32 csi_access_viol;
 };
 
-struct atomisp_sw_contex {
-       int running_freq;
-};
-
 #define ATOMISP_DEVICE_STREAMING_DISABLED      0
 #define ATOMISP_DEVICE_STREAMING_ENABLED       1
 #define ATOMISP_DEVICE_STREAMING_STOPPING      2
@@ -242,7 +238,6 @@ struct atomisp_device {
        struct v4l2_subdev *motor;
 
        struct atomisp_regs saved_regs;
-       struct atomisp_sw_contex sw_contex;
        struct atomisp_css_env css_env;
 
        /* isp timeout status flag */
@@ -257,6 +252,7 @@ struct atomisp_device {
        unsigned int mipi_frame_size;
        const struct atomisp_dfs_config *dfs;
        unsigned int hpll_freq;
+       unsigned int running_freq;
 
        bool css_initialized;
 };