mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Hermes.Wu@ite.com.tw>
To: <sakari.ailus@linux.intel.com>
Cc: <mchehab@kernel.org>, <robh@kernel.org>, <krzk+dt@kernel.org>,
	<conor+dt@kernel.org>, <linux-media@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 02/21] media: i2c: it6625: propagate control-update errors
Date: Fri, 18 Sep 2026 11:05:59 +0000	[thread overview]
Message-ID: <d25be49aa66e49d7a7d58fd2a00e4cf6@ite.com.tw> (raw)
In-Reply-To: <aq0M7AO3k8Q8CFuo@kekkonen.localdomain>

Hi Sakari

Thanks for review.

>Hi Hermes,
>
>On Fri, Sep 18, 2026 at 04:57:17PM +0800, Hermes Wu via B4 Relay wrote:
>> From: Hermes Wu <Hermes.wu@ite.com.tw>
>> 
>> it6625_v4l2_sd_ctrl_update() discarded the return value of all three
>> v4l2_ctrl_s_ctrl() calls it makes. Make it return int, run the updates 
>> sequentially, and return the first error; both call sites now check 
>> and log it.
>> 
>> None of the three controls has a driver .ops, so the only failure path 
>> in v4l2_ctrl_s_ctrl() is range validation, and every value this driver 
>> passes is always in range -- this is an error-handling correctness fix 
>> responsive to review, not a fix for an observed runtime failure.
>> 
>> Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
>> ---
>>  drivers/media/i2c/it6625.c | 25 +++++++++++++++++++------
>>  1 file changed, 19 insertions(+), 6 deletions(-)
>> 
>> diff --git a/drivers/media/i2c/it6625.c b/drivers/media/i2c/it6625.c 
>> index 
>> da17e5d5ce9e2dd1060abba1598b0e3f78857e9c..5d267676606e340ad0ee5ad2b78e
>> 5acb50a32980 100644
>> --- a/drivers/media/i2c/it6625.c
>> +++ b/drivers/media/i2c/it6625.c
>> @@ -889,11 +889,19 @@ static int it6625_s_ctrl_audio_present(struct v4l2_subdev *sd)
>>  				audio_present(it6625));
>>  }
>>  
>> -static void it6625_v4l2_sd_ctrl_update(struct v4l2_subdev *sd)
>> +static int it6625_v4l2_sd_ctrl_update(struct v4l2_subdev *sd)
>>  {
>> -	it6625_s_ctrl_detect_hdmi_5v(sd);
>> -	it6625_s_ctrl_audio_sampling_rate(sd);
>> -	it6625_s_ctrl_audio_present(sd);
>> +	int ret;
>> +
>> +	ret = it6625_s_ctrl_detect_hdmi_5v(sd);
>> +	if (ret)
>> +		return ret;
>> +
>> +	ret = it6625_s_ctrl_audio_sampling_rate(sd);
>> +	if (ret)
>> +		return ret;
>> +
>> +	return it6625_s_ctrl_audio_present(sd);
>>  }
>>  
>>  static void it6625_enable_stream_locked(struct it6625 *it6625, bool 
>> enable) @@ -1136,9 +1144,12 @@ static void it6625_clear_timings(struct 
>> it6625 *it6625)  static void it6625_irq_hdmi_5v_change(struct it6625 
>> *it6625)  {
>>  	struct v4l2_subdev *sd = &it6625->sd;
>> +	int ret;
>>  
>>  	it6625_clear_timings(it6625);
>> -	it6625_v4l2_sd_ctrl_update(sd);
>> +	ret = it6625_v4l2_sd_ctrl_update(sd);
>> +	if (ret)
>> +		dev_err(it6625->dev, "%s: failed to update controls: %d", __func__, 
>> +ret);
>>  }
>>  
>>  static void it6625_irq_hdcp_change(struct it6625 *it6625) @@ -2297,7 
>> +2308,9 @@ static int it6625_probe(struct i2c_client *client)
>>  	it6625_debugfs_init(it6625, client);
>>  
>>  	it6625_initial_setup(it6625);
>
>What if this fails?

will fix in v2
>> -	it6625_v4l2_sd_ctrl_update(sd);
>> +	err = it6625_v4l2_sd_ctrl_update(sd);
>> +	if (err)
>> +		dev_err(it6625->dev, "%s: failed to update controls: %d", __func__, 
>> +err);
>
>Shouldn't you return an error in this case?
>
will fix in v2

>dev_err_probe() might be better here, too.
>
>>  
>>  	err = v4l2_async_register_subdev(sd);
>>  	if (err < 0) {
>> 
>
>--
>Regards,
>
>Sakari Ailus
>

  reply	other threads:[~2026-09-18 11:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18  8:57 [PATCH 00/21] media: i2c: it6625: address review feedback and adopt subdev state Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 01/21] media: dt-bindings: ite,it6625: document the default CSI-2 bus type Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 02/21] media: i2c: it6625: propagate control-update errors Hermes Wu via B4 Relay
2026-09-18 10:05   ` Sakari Ailus
2026-09-18 11:05     ` Hermes.Wu [this message]
2026-09-18  8:57 ` [PATCH 03/21] media: i2c: it6625: default the debug module parameter to 0 Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 04/21] media: i2c: it6625: drop unused bus field from struct it6625 Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 05/21] media: i2c: it6625: drop stale GCC < 4.4.6 workaround Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 06/21] media: i2c: it6625: use unsigned int loop indices in table lookups Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 07/21] media: i2c: it6625: drop redundant parentheses in status helpers Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 08/21] media: i2c: it6625: make the audio sampling-rate table static const Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 09/21] media: i2c: it6625: tidy CEC buffer init and a continuation line Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 10/21] media: i2c: it6625: clean up it6625_wait_for_status() Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 11/21] media: i2c: it6625: use unsigned int indices in EDID read/write Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 12/21] media: i2c: it6625: use unaligned/units helpers to decode pixel clock Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 13/21] media: i2c: it6625: decode detected timings via typed register structs Hermes Wu via B4 Relay
2026-09-18 10:09   ` Sakari Ailus
2026-09-18  8:57 ` [PATCH 14/21] media: i2c: it6625: fix link-frequency reporting for one-/two-trio C-PHY Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 15/21] media: i2c: it6625: use early returns in it6625_update_timings_if_changed() Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 16/21] media: i2c: it6625: drop the private CSI-format name table Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 17/21] media: i2c: it6625: require a DT endpoint and simplify endpoint parsing Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 18/21] media: i2c: it6625: finish reverse fir-tree declaration order Hermes Wu via B4 Relay
2026-09-18  8:57 ` [PATCH 19/21] media: i2c: it6625: fold subdev initialization into probe Hermes Wu via B4 Relay
2026-09-18 10:13   ` Sakari Ailus
2026-09-18  8:57 ` [PATCH 20/21] media: i2c: it6625: use centrally managed active state Hermes Wu via B4 Relay
2026-09-18 10:24   ` Sakari Ailus
2026-09-18 11:19     ` Hermes.Wu
2026-09-18 15:28       ` Sakari Ailus
2026-09-18  8:57 ` [PATCH 21/21] media: i2c: it6625: use enable_streams and disable_streams Hermes Wu via B4 Relay

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=d25be49aa66e49d7a7d58fd2a00e4cf6@ite.com.tw \
    --to=hermes.wu@ite.com.tw \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@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

all inboxes | Powered by JetHome®