Re: [PATCH 5/9] ov5642: avoid calling ov5642_find_datafmt() twice

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

 



On 05/03/2015 10:24 PM, Guennadi Liakhovetski wrote:
> Hi Hans,
> 
> On Sun, 3 May 2015, Hans Verkuil wrote:
> 
>> From: Hans Verkuil <hans.verkuil@xxxxxxxxx>
>>
>> Simplify ov5642_set_fmt().
>>
>> Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx>
>> Reported-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
>> ---
>>  drivers/media/i2c/soc_camera/ov5642.c | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/media/i2c/soc_camera/ov5642.c b/drivers/media/i2c/soc_camera/ov5642.c
>> index bab9ac0..061fca3 100644
>> --- a/drivers/media/i2c/soc_camera/ov5642.c
>> +++ b/drivers/media/i2c/soc_camera/ov5642.c
>> @@ -804,14 +804,15 @@ static int ov5642_set_fmt(struct v4l2_subdev *sd,
>>  	if (!fmt) {
>>  		if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
>>  			return -EINVAL;
>> -		mf->code	= ov5642_colour_fmts[0].code;
>> -		mf->colorspace	= ov5642_colour_fmts[0].colorspace;
>> +		fmt = ov5642_colour_fmts;
>> +		mf->code = fmt->code;
>> +		mf->colorspace = fmt->colorspace;
> 
> Again - I still don't see why this is needed.

Same thing, missed the if statement just before these lines.

Will fix.

	Hans

> 
> Thanks
> Guennadi
> 
>>  	}
>>  
>>  	mf->field	= V4L2_FIELD_NONE;
>>  
>>  	if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
>> -		priv->fmt = ov5642_find_datafmt(mf->code);
>> +		priv->fmt = fmt;
>>  	else
>>  		cfg->try_fmt = *mf;
>>  	return 0;
>> -- 
>> 2.1.4
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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