Linux Media Controller development
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Mehdi Djait <mehdi.djait@linux.intel.com>
Cc: linux-media@vger.kernel.org, david@ixit.cz
Subject: Re: [PATCH] media: ccs: Print a warning on CCS static data parse failure
Date: Mon, 9 Dec 2024 11:40:00 +0000	[thread overview]
Message-ID: <Z1bXED_CbIvPUDUG@kekkonen.localdomain> (raw)
In-Reply-To: <20241209111738.79679-1-mehdi.djait@linux.intel.com>

Hi Mehdi,

On Mon, Dec 09, 2024 at 12:17:38PM +0100, Mehdi Djait wrote:
> ccs_data_parse() return value is not propagated up to the probe
> function, making it difficult on static data parse Failure.

Could you reword this by referring to the CCS static data library only?
This would fit better for the CCS tools where the patch will also be
imported to.

<URL:https://github.com/MIPI-Alliance/ccs-tools>

I also wonder if the CCS driver should actually fail probe if parsing
fails: this is a very likely problem and quitting there would be
appropriate IMO. Not every device might need one, so it should be just
based on parser failure.

Thanks.

> Improve this by printing a warning when ccs_data_parse() fails.
> 
> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com>
> ---
>  drivers/media/i2c/ccs/ccs-data.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/i2c/ccs/ccs-data.c b/drivers/media/i2c/ccs/ccs-data.c
> index c40d859166dd..f64fbfa1c7b5 100644
> --- a/drivers/media/i2c/ccs/ccs-data.c
> +++ b/drivers/media/i2c/ccs/ccs-data.c
> @@ -976,6 +976,7 @@ int ccs_data_parse(struct ccs_data_container *ccsdata, const void *data,
>  out_cleanup:
>  	kvfree(bin.base);
>  	memset(ccsdata, 0, sizeof(*ccsdata));
> +	dev_warn(dev, "failed to parse CCS static data file: %d\n", rval);

s/ file//

>  
>  	return rval;
>  }

-- 
Kind regards,

Sakari Ailus

  reply	other threads:[~2024-12-09 11:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 11:17 [PATCH] media: ccs: Print a warning on CCS static data parse failure Mehdi Djait
2024-12-09 11:40 ` Sakari Ailus [this message]
2024-12-10  8:53   ` Mehdi Djait

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z1bXED_CbIvPUDUG@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=david@ixit.cz \
    --cc=linux-media@vger.kernel.org \
    --cc=mehdi.djait@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox