diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-28 10:01:53 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-11 18:22:56 +0200 |
commit | 41022d35ddf219361f33b59034cc67430a6a590f (patch) | |
tree | 60f0b2296cd252d65f51735ea6ccf71f841a235d /drivers/staging/media/atomisp/pci/isp | |
parent | abbd669dbfbb8c68936b575fe296af3a3184ed3d (diff) | |
download | linux-41022d35ddf219361f33b59034cc67430a6a590f.tar.bz2 |
media: atomisp: get rid of non-Linux error codes
The atomisp driver has its own error codes under the
ia_css_err.h file. On several places, those got already
replaced by standard error codes, but there are still a
lot more to be fixed.
Let's get rid of all of those, mapping them into
the already-existing set of Linux error codes.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/pci/isp')
10 files changed, 30 insertions, 30 deletions
diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.c index 4dd0b0373e79..a0e483a2d66a 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.c +++ b/drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.c @@ -271,7 +271,7 @@ convert_allocate_dvs_6axis_config( return me; } -enum ia_css_err +int store_dvs_6axis_config( const struct ia_css_dvs_6axis_config *dvs_6axis_config, const struct ia_css_binary *binary, @@ -289,8 +289,8 @@ store_dvs_6axis_config( if (!me) { - IA_CSS_LEAVE_ERR_PRIVATE(IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY); - return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY; + IA_CSS_LEAVE_ERR_PRIVATE(-ENOMEM); + return -ENOMEM; } ia_css_params_store_ia_css_host_data( @@ -298,5 +298,5 @@ store_dvs_6axis_config( me); ia_css_host_data_free(me); - return IA_CSS_SUCCESS; + return 0; } diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.h b/drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.h index 81c2d4ef71e2..660c20110432 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.h +++ b/drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.h @@ -50,7 +50,7 @@ convert_allocate_dvs_6axis_config( const struct ia_css_binary *binary, const struct ia_css_frame_info *dvs_in_frame_info); -enum ia_css_err +int store_dvs_6axis_config( const struct ia_css_dvs_6axis_config *dvs_6axis_config, const struct ia_css_binary *binary, diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/iterator/iterator_1.0/ia_css_iterator.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/iterator/iterator_1.0/ia_css_iterator.host.c index 49c1b3e3370d..808815ba8f4d 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/iterator/iterator_1.0/ia_css_iterator.host.c +++ b/drivers/staging/media/atomisp/pci/isp/kernels/iterator/iterator_1.0/ia_css_iterator.host.c @@ -37,7 +37,7 @@ ia_css_iterator_config( ia_css_resolution_to_sp_resolution(&to->dvs_envelope, from->dvs_envelope); } -enum ia_css_err +int ia_css_iterator_configure( const struct ia_css_binary *binary, const struct ia_css_frame_info *in_info) { @@ -76,5 +76,5 @@ ia_css_iterator_configure( ia_css_configure_iterator(binary, &config); - return IA_CSS_SUCCESS; + return 0; } diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/iterator/iterator_1.0/ia_css_iterator.host.h b/drivers/staging/media/atomisp/pci/isp/kernels/iterator/iterator_1.0/ia_css_iterator.host.h index c5e8d58e0fe1..85a816276323 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/iterator/iterator_1.0/ia_css_iterator.host.h +++ b/drivers/staging/media/atomisp/pci/isp/kernels/iterator/iterator_1.0/ia_css_iterator.host.h @@ -26,7 +26,7 @@ ia_css_iterator_config( const struct ia_css_iterator_configuration *from, unsigned int size); -enum ia_css_err +int ia_css_iterator_configure( const struct ia_css_binary *binary, const struct ia_css_frame_info *in_info); diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c index 2fe081ee005a..1cbcf070ab00 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c +++ b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c @@ -235,12 +235,12 @@ void ia_css_sdis_clear_coefficients( dvs_coefs->ver_coefs = NULL; } -enum ia_css_err +int ia_css_get_dvs_statistics( struct ia_css_dvs_statistics *host_stats, const struct ia_css_isp_dvs_statistics *isp_stats) { struct ia_css_isp_dvs_statistics_map *map; - enum ia_css_err ret = IA_CSS_SUCCESS; + int ret = 0; IA_CSS_ENTER("host_stats=%p, isp_stats=%p", host_stats, isp_stats); @@ -256,7 +256,7 @@ ia_css_get_dvs_statistics( } else { IA_CSS_ERROR("out of memory"); - ret = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY; + ret = -ENOMEM; } IA_CSS_LEAVE_ERR(ret); diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.h b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.h index b1b0cb8ea175..d670bfa7f826 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.h +++ b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.h @@ -53,7 +53,7 @@ void ia_css_get_isp_dis_coefficients( short *horizontal_coefficients, short *vertical_coefficients); -enum ia_css_err +int ia_css_get_dvs_statistics( struct ia_css_dvs_statistics *host_stats, const struct ia_css_isp_dvs_statistics *isp_stats); diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c index 2d2708bde17e..c855467cd20c 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c +++ b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.c @@ -175,12 +175,12 @@ void ia_css_sdis2_clear_coefficients( dvs2_coefs->ver_coefs.even_imag = NULL; } -enum ia_css_err +int ia_css_get_dvs2_statistics( struct ia_css_dvs2_statistics *host_stats, const struct ia_css_isp_dvs_statistics *isp_stats) { struct ia_css_isp_dvs_statistics_map *map; - enum ia_css_err ret = IA_CSS_SUCCESS; + int ret = 0; IA_CSS_ENTER("host_stats=%p, isp_stats=%p", host_stats, isp_stats); @@ -196,7 +196,7 @@ ia_css_get_dvs2_statistics( } else { IA_CSS_ERROR("out of memory"); - ret = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY; + ret = -ENOMEM; } IA_CSS_LEAVE_ERR(ret); diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.h b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.h index a966a6bcb692..b6d103d862be 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.h +++ b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.h @@ -62,7 +62,7 @@ void ia_css_get_isp_dvs2_coefficients( void ia_css_sdis2_clear_coefficients( struct ia_css_dvs2_coefficients *dvs2_coefs); -enum ia_css_err +int ia_css_get_dvs2_statistics( struct ia_css_dvs2_statistics *host_stats, const struct ia_css_isp_dvs_statistics *isp_stats); diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c index be274d680caf..8599d865e93a 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c +++ b/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c @@ -49,7 +49,7 @@ ia_css_vf_config( * to the requested viewfinder resolution on the upper side. The output cannot * be smaller than the requested viewfinder resolution. */ -enum ia_css_err +int sh_css_vf_downscale_log2( const struct ia_css_frame_info *out_info, const struct ia_css_frame_info *vf_info, @@ -58,12 +58,12 @@ sh_css_vf_downscale_log2( unsigned int out_width; if ((!out_info) | (!vf_info)) - return IA_CSS_ERR_INVALID_ARGUMENTS; + return -EINVAL; out_width = out_info->res.width; if (out_width == 0) - return IA_CSS_ERR_INVALID_ARGUMENTS; + return -EINVAL; /* downscale until width smaller than the viewfinder width. We don't * test for the height since the vmem buffers only put restrictions on @@ -79,26 +79,26 @@ sh_css_vf_downscale_log2( ds_log2--; /* TODO: use actual max input resolution of vf_pp binary */ if ((out_info->res.width >> ds_log2) >= 2 * ia_css_binary_max_vf_width()) - return IA_CSS_ERR_INVALID_ARGUMENTS; + return -EINVAL; *downscale_log2 = ds_log2; - return IA_CSS_SUCCESS; + return 0; } -static enum ia_css_err +static int configure_kernel( const struct ia_css_binary_info *info, const struct ia_css_frame_info *out_info, const struct ia_css_frame_info *vf_info, unsigned int *downscale_log2, struct ia_css_vf_configuration *config) { - enum ia_css_err err; + int err; unsigned int vf_log_ds = 0; /* First compute value */ if (vf_info) { err = sh_css_vf_downscale_log2(out_info, vf_info, &vf_log_ds); - if (err != IA_CSS_SUCCESS) + if (err) return err; } vf_log_ds = min(vf_log_ds, info->vf_dec.max_log_downscale); @@ -106,7 +106,7 @@ configure_kernel( /* Then store it in isp config section */ config->vf_downscale_bits = vf_log_ds; - return IA_CSS_SUCCESS; + return 0; } static void @@ -117,13 +117,13 @@ configure_dma( config->info = vf_info; } -enum ia_css_err +int ia_css_vf_configure( const struct ia_css_binary *binary, const struct ia_css_frame_info *out_info, struct ia_css_frame_info *vf_info, unsigned int *downscale_log2) { - enum ia_css_err err; + int err; struct ia_css_vf_configuration config; const struct ia_css_binary_info *info = &binary->info->sp; @@ -134,5 +134,5 @@ ia_css_vf_configure( vf_info->raw_bit_depth = info->dma.vfdec_bits_per_pixel; ia_css_configure_vf(binary, &config); - return IA_CSS_SUCCESS; + return 0; } diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.h b/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.h index 9cc594f9a840..5aa4db1ac6bb 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.h +++ b/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.h @@ -25,7 +25,7 @@ * to the requested viewfinder resolution on the upper side. The output cannot * be smaller than the requested viewfinder resolution. */ -enum ia_css_err +int sh_css_vf_downscale_log2( const struct ia_css_frame_info *out_info, const struct ia_css_frame_info *vf_info, @@ -37,7 +37,7 @@ ia_css_vf_config( const struct ia_css_vf_configuration *from, unsigned int size); -enum ia_css_err +int ia_css_vf_configure( const struct ia_css_binary *binary, const struct ia_css_frame_info *out_info, |