Re: [PATCH 1/2] media: max9271: Fail loudly on bus read errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jacopo,

Thanks for your work.

On 2021-11-03 21:46:53 +0100, Jacopo Mondi wrote:
> Read errors were silently going ignored. Fail louder to make sure such
> errors are visible.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@xxxxxxxxxx>
> ---
>  drivers/media/i2c/max9271.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/max9271.c b/drivers/media/i2c/max9271.c
> index ff86c8c4ea61..aa9ab6831574 100644
> --- a/drivers/media/i2c/max9271.c
> +++ b/drivers/media/i2c/max9271.c
> @@ -30,7 +30,7 @@ static int max9271_read(struct max9271_device *dev, u8 reg)
>  
>  	ret = i2c_smbus_read_byte_data(dev->client, reg);
>  	if (ret < 0)
> -		dev_dbg(&dev->client->dev,
> +		dev_err(&dev->client->dev,

This feels a bit illogical as all call sites handles the return code and 
acts accordingly. For some it's OK to fail and for others where it's not 
a dev_err() is reported, for example in max9271_verify_id().

Will this not log error messages in situations where there really is no 
error? Maybe dev_info() is a better choice if you want to increase 
verbosity?

>  			"%s: register 0x%02x read failed (%d)\n",
>  			__func__, reg, ret);
>  
> -- 
> 2.33.1
> 

-- 
Regards,
Niklas Söderlund



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux