[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230129112413.vrlcwkdujvl2msex@uno.localdomain>
Date: Sun, 29 Jan 2023 12:24:13 +0100
From: Jacopo Mondi <jacopo.mondi@...asonboard.com>
To: Luca Weiss <luca@...tu.xyz>
Cc: ~postmarketos/upstreaming@...ts.sr.ht, phone-devel@...r.kernel.org,
Shunqian Zheng <zhengsq@...k-chips.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Jacopo Mondi <jacopo.mondi@...asonboard.com>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] media: i2c: ov2685: Add print for power on write
failed
Hi Luca
On Sun, Jan 29, 2023 at 10:42:36AM +0100, Luca Weiss wrote:
> If the sensor doens't power up correctly, for example due to incorrect
> devicetree description, the power up i2c writes will fail.
>
> Add an error print for this situation.
>
> Signed-off-by: Luca Weiss <luca@...tu.xyz>
> ---
> drivers/media/i2c/ov2685.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c
> index a422f4c8a2eb..844a91dbc8e5 100644
> --- a/drivers/media/i2c/ov2685.c
> +++ b/drivers/media/i2c/ov2685.c
> @@ -419,8 +419,10 @@ static int __ov2685_power_on(struct ov2685 *ov2685)
> * writing register before .s_stream() as a workaround
> */
> ret = ov2685_write_array(ov2685->client, ov2685->cur_mode->reg_list);
> - if (ret)
> + if (ret) {
> + dev_err(dev, "Failed to set regs for power on\n");
> goto disable_supplies;
> + }
This is fine. I would also consider if it's worth to fail loud in
ov2685_write_reg().
Reviewed-by: Jacopo Mondi <jacopo.mondi@...asonboard.com>
>
> return 0;
>
>
> --
> 2.39.1
>
Powered by blists - more mailing lists