[media] atomisp: Unify lut free logic
authorAlan Cox <alan@llwyncelyn.cymru>
Fri, 26 May 2017 15:29:25 +0000 (12:29 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 7 Jun 2017 15:44:39 +0000 (12:44 -0300)
ISP2401 introduced a helper for this which we can use just as well on the
ISP2400 and remove some more noise differences.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c

index 55d2a69f4e92594b49dc43fe86abbdcc6d72d13d..dfef219c4bef0518e81cee7a82cc05bdc4282e1c 100644 (file)
@@ -2533,15 +2533,8 @@ ia_css_pipe_destroy(struct ia_css_pipe *pipe)
                break;
        }
 
-#ifndef ISP2401
-       if (pipe->scaler_pp_lut != mmgr_NULL) {
-               hmm_free(pipe->scaler_pp_lut);
-               pipe->scaler_pp_lut = mmgr_NULL;
-       }
-#else
        sh_css_params_free_gdc_lut(pipe->scaler_pp_lut);
        pipe->scaler_pp_lut = mmgr_NULL;
-#endif
 
        my_css.active_pipes[ia_css_pipe_get_pipe_num(pipe)] = NULL;
        sh_css_pipe_free_shading_table(pipe);
index d8c22e8cd3af51c560609a828631c17eccfa304f..48224370b8bfd1d0561187259423c530fb4de717 100644 (file)
@@ -3356,15 +3356,8 @@ enum ia_css_err ia_css_pipe_set_bci_scaler_lut(struct ia_css_pipe *pipe,
        }
 
        /* Free any existing tables. */
-#ifndef ISP2401
-       if (pipe->scaler_pp_lut != mmgr_NULL) {
-               hmm_free(pipe->scaler_pp_lut);
-               pipe->scaler_pp_lut = mmgr_NULL;
-       }
-#else
        sh_css_params_free_gdc_lut(pipe->scaler_pp_lut);
        pipe->scaler_pp_lut = mmgr_NULL;
-#endif
 
 #ifndef ISP2401
        if (store) {
@@ -3445,15 +3438,8 @@ void sh_css_params_free_default_gdc_lut(void)
 {
        IA_CSS_ENTER_PRIVATE("void");
 
-#ifndef ISP2401
-       if (default_gdc_lut != mmgr_NULL) {
-               hmm_free(default_gdc_lut);
-               default_gdc_lut = mmgr_NULL;
-       }
-#else
        sh_css_params_free_gdc_lut(default_gdc_lut);
        default_gdc_lut = mmgr_NULL;
-#endif
 
        IA_CSS_LEAVE_PRIVATE("void");