lkml.org 
[lkml]   [2021]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 06/10] staging: media: zoran: fusion all modules
On Wed, Oct 13, 2021 at 06:58:08PM +0000, Corentin Labbe wrote:
> +static int load_codec(struct zoran *zr, u16 codecid)
> +{
> + switch (codecid) {
> + case CODEC_TYPE_ZR36060:
> +#ifdef CONFIG_VIDEO_ZORAN_ZR36060
> + return zr36060_init_module();
> +#else
> + pci_err(zr->pci_dev, "ZR36060 support is not enabled\n");
> + return -EINVAL;
> +#endif
> + break;
> + case CODEC_TYPE_ZR36050:
> +#ifdef CONFIG_VIDEO_ZORAN_DC30
> + return zr36050_init_module();
> +#else
> + pci_err(zr->pci_dev, "ZR36050 support is not enabled\n");
> + return -EINVAL;
> +#endif
> + break;
> + case CODEC_TYPE_ZR36016:
> +#ifdef CONFIG_VIDEO_ZORAN_DC30
> + return zr36016_init_module();
> +#else
> + pci_err(zr->pci_dev, "ZR36016 support is not enabled\n");
> + return -EINVAL;
> +#endif

The caller already prints an error message. Can you look through the
dmesg and make sure were not printing a bunch of duplicate stuff? Also
if load_codec() fails, the probe function still does
zoran_setup_videocodec() on the failed codec.

These would be better in a .h file.

#ifdef CONFIG_VIDEO_ZORAN_ZR36060
int zr36060_init_module(void);
#else
int zr36060_init_module(void) { return -EINVAL; }
#endif

regards,
dan carpenter

\
 
 \ /
  Last update: 2021-10-14 09:57    [W:0.228 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site