mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muzaffer Kadir <muzafferkadir@mainlining.org>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: "Mauro Carvalho Chehab" <mchehab@kernel.org>,
	git@luigi311.com, pavel@ucw.cz, tomm.merciai@gmail.com,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	phone-devel@vger.kernel.org, "Ondřej Jirman" <megi@xff.cz>
Subject: Re: [PATCH] media: i2c: imx258: Add reset-gpio support
Date: Fri, 28 Aug 2026 20:22:42 +0300	[thread overview]
Message-ID: <7e5d41c0-247d-45bf-97fd-1c1414588936@mainlining.org> (raw)
In-Reply-To: <apF5oxsCf7MJt1lk@kekkonen.localdomain>

Thanks for review

On Fri, 28 Aug 2026 15:05:55 +0300, Sakari Ailus wrote:

>>  	if (ret) {
>>  		dev_err(dev, "failed to enable clock\n");
>>  		regulator_bulk_disable(IMX258_NUM_SUPPLIES, imx258->supplies);
>> +		return ret;
>> +	}
>> +
>> +	if (imx258->reset_gpio) {
>> +		ret = gpiod_set_value_cansleep(imx258->reset_gpio, 0);
>> +		if (ret) {
>> +			dev_err(dev, "failed to deassert reset\n");
>> +			clk_disable_unprepare(imx258->clk);
>> +			regulator_bulk_disable(IMX258_NUM_SUPPLIES, imx258->supplies);
>> +			return ret;
> 
> This warrants reworking error handling; please use gotos and move it to the
> end of the function. Same for clock error handling.
I will move error handling to goto by sending a v2.

>> +		usleep_range(400, 500);
> 
> The delay seems right. Can you use fsleep()?
I am going to replace it with fsleep(400) by v2

> In fact the delay should always have been there so this is a bugfix. It
> should go to a separate patch.
Then I will split this by making delay first patch
and reset handling second patch for v2.

>>  	struct v4l2_subdev *sd = dev_get_drvdata(dev);
>>  	struct imx258 *imx258 = to_imx258(sd);
>>  
>> +	gpiod_set_value_cansleep(imx258->reset_gpio, 1);
>>  	clk_disable_unprepare(imx258->clk);
>>  	regulator_bulk_disable(IMX258_NUM_SUPPLIES, imx258->supplies);
>>  
>> @@ -1382,6 +1397,11 @@ static int imx258_probe(struct i2c_client *client)
>>  		return ret;
>>  	}
>>  
>> +	imx258->reset_gpio = devm_gpiod_get_optional(imx258->dev, "reset", GPIOD_OUT_HIGH);
> 
> Over 80, please wrap (there's another earlier, too).
I am going to wrap this by v2 but I couldn't spot the second one.
I think it is regulator_bulk_disable in error handling.
It should be lower than 80 after moving it to goto error handling.

-- 
Best Regards,

Muzaffer Kadir

  reply	other threads:[~2026-08-28 17:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 10:51 Muzaffer Kadir via B4 Relay
2026-08-28 12:05 ` Sakari Ailus
2026-08-28 17:22   ` Muzaffer Kadir [this message]
2026-08-28 18:16 ` Ondřej Jirman
2026-08-29 10:28   ` Muzaffer Kadir
2026-08-29 10:33     ` Ondřej Jirman

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=7e5d41c0-247d-45bf-97fd-1c1414588936@mainlining.org \
    --to=muzafferkadir@mainlining.org \
    --cc=git@luigi311.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=megi@xff.cz \
    --cc=pavel@ucw.cz \
    --cc=phone-devel@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tomm.merciai@gmail.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®