media: atomisp: remove force argument from __destroy_[stream[s]|pipe[s]]()
authorHans de Goede <hdegoede@redhat.com>
Wed, 15 Jun 2022 20:50:36 +0000 (21:50 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 8 Jul 2022 15:38:14 +0000 (16:38 +0100)
The force argument to the __destroy_pipe[s]() and __destroy_stream[s]()
functions is always true. Remove the argument and remove the code necessary
to handle the false case.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-40-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_compat_css20.c

index cc8bc3fd1f10bf583c62f2d0626d265d9d1ec6fc..5aa108a1724c6829b4c5be9c0b33d307a6d2a141 100644 (file)
@@ -418,24 +418,14 @@ static void __dump_stream_config(struct atomisp_sub_device *asd,
 }
 
 static int __destroy_stream(struct atomisp_sub_device *asd,
-                           struct atomisp_stream_env *stream_env, bool force)
+                           struct atomisp_stream_env *stream_env)
 {
        struct atomisp_device *isp = asd->isp;
-       int i;
        unsigned long timeout;
 
        if (!stream_env->stream)
                return 0;
 
-       if (!force) {
-               for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++)
-                       if (stream_env->update_pipe[i])
-                               break;
-
-               if (i == IA_CSS_PIPE_ID_NUM)
-                       return 0;
-       }
-
        if (stream_env->stream_state == CSS_STREAM_STARTED
            && ia_css_stream_stop(stream_env->stream) != 0) {
                dev_err(isp->dev, "stop stream failed.\n");
@@ -469,12 +459,12 @@ static int __destroy_stream(struct atomisp_sub_device *asd,
        return 0;
 }
 
-static int __destroy_streams(struct atomisp_sub_device *asd, bool force)
+static int __destroy_streams(struct atomisp_sub_device *asd)
 {
        int ret, i;
 
        for (i = 0; i < ATOMISP_INPUT_STREAM_NUM; i++) {
-               ret = __destroy_stream(asd, &asd->stream_env[i], force);
+               ret = __destroy_stream(asd, &asd->stream_env[i]);
                if (ret)
                        return ret;
        }
@@ -529,21 +519,19 @@ static int __create_streams(struct atomisp_sub_device *asd)
        return 0;
 rollback:
        for (i--; i >= 0; i--)
-               __destroy_stream(asd, &asd->stream_env[i], true);
+               __destroy_stream(asd, &asd->stream_env[i]);
        return ret;
 }
 
 static int __destroy_stream_pipes(struct atomisp_sub_device *asd,
-                                 struct atomisp_stream_env *stream_env,
-                                 bool force)
+                                 struct atomisp_stream_env *stream_env)
 {
        struct atomisp_device *isp = asd->isp;
        int ret = 0;
        int i;
 
        for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++) {
-               if (!stream_env->pipes[i] ||
-                   !(force || stream_env->update_pipe[i]))
+               if (!stream_env->pipes[i])
                        continue;
                if (ia_css_pipe_destroy(stream_env->pipes[i])
                    != 0) {
@@ -557,7 +545,7 @@ static int __destroy_stream_pipes(struct atomisp_sub_device *asd,
        return ret;
 }
 
-static int __destroy_pipes(struct atomisp_sub_device *asd, bool force)
+static int __destroy_pipes(struct atomisp_sub_device *asd)
 {
        struct atomisp_device *isp = asd->isp;
        int i;
@@ -571,7 +559,7 @@ static int __destroy_pipes(struct atomisp_sub_device *asd, bool force)
                        continue;
                }
 
-               ret = __destroy_stream_pipes(asd, &asd->stream_env[i], force);
+               ret = __destroy_stream_pipes(asd, &asd->stream_env[i]);
                if (ret)
                        return ret;
        }
@@ -581,10 +569,10 @@ static int __destroy_pipes(struct atomisp_sub_device *asd, bool force)
 
 void atomisp_destroy_pipes_stream_force(struct atomisp_sub_device *asd)
 {
-       if (__destroy_streams(asd, true))
+       if (__destroy_streams(asd))
                dev_warn(asd->isp->dev, "destroy stream failed.\n");
 
-       if (__destroy_pipes(asd, true))
+       if (__destroy_pipes(asd))
                dev_warn(asd->isp->dev, "destroy pipe failed.\n");
 }
 
@@ -801,7 +789,7 @@ int atomisp_create_pipes_stream(struct atomisp_sub_device *asd)
        ret = __create_streams(asd);
        if (ret) {
                dev_warn(asd->isp->dev, "create stream failed %d.\n", ret);
-               __destroy_pipes(asd, true);
+               __destroy_pipes(asd);
                return ret;
        }