Re: [PATCH] media: ov5640: add error trace in case of i2c read failure

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

 



Hi Sakari,
I've made it symetric to ov5640_write_reg() which also uses v4l2_err,
I will change both so we are gone with all v4l2_err.

BR,
Hugues.

On 01/31/2018 12:57 PM, Sakari Ailus wrote:
> On Wed, Jan 31, 2018 at 12:19:24PM +0100, Hugues Fruchet wrote:
>> Add an error trace in ov5640_read_reg() in case of i2c_transfer()
>> failure.
>>
>> Signed-off-by: Hugues Fruchet <hugues.fruchet@xxxxxx>
>> ---
>>   drivers/media/i2c/ov5640.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
>> index 99a5902..882a7c3 100644
>> --- a/drivers/media/i2c/ov5640.c
>> +++ b/drivers/media/i2c/ov5640.c
>> @@ -868,8 +868,11 @@ static int ov5640_read_reg(struct ov5640_dev *sensor, u16 reg, u8 *val)
>>   	msg[1].len = 1;
>>   
>>   	ret = i2c_transfer(client->adapter, msg, 2);
>> -	if (ret < 0)
>> +	if (ret < 0) {
>> +		v4l2_err(&sensor->sd, "%s: error: reg=%x\n",
> 
> The driver uses dev_ macros almost universally, how about doing the same
> here?
> 
>> +			 __func__, reg);
>>   		return ret;
>> +	}
>>   
>>   	*val = buf[0];
>>   	return 0;
>> -- 
>> 1.9.1
>>
> 




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux