public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/5] media:dvb:fix up ENOIOCTLCMD error handling
       [not found] <1346052196-32682-1-git-send-email-gaowanlong@cn.fujitsu.com>
@ 2012-08-27  7:23 ` Wanlong Gao
  2012-08-27  7:23 ` [PATCH 4/5] video:omap3isp:fix " Wanlong Gao
  1 sibling, 0 replies; 6+ messages in thread
From: Wanlong Gao @ 2012-08-27  7:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Wanlong Gao, Mauro Carvalho Chehab, linux-media

At commit 07d106d0, Linus pointed out that ENOIOCTLCMD should be
translated as ENOTTY to user mode.

Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: linux-media@vger.kernel.org
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
---
 drivers/media/dvb/dvb-core/dvbdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index 39eab73..d33101a 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -420,7 +420,7 @@ int dvb_usercopy(struct file *file,
 	/* call driver */
 	mutex_lock(&dvbdev_mutex);
 	if ((err = func(file, cmd, parg)) == -ENOIOCTLCMD)
-		err = -EINVAL;
+		err = -ENOTTY;
 	mutex_unlock(&dvbdev_mutex);
 
 	if (err < 0)
-- 
1.7.12


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/5] video:omap3isp:fix up ENOIOCTLCMD error handling
       [not found] <1346052196-32682-1-git-send-email-gaowanlong@cn.fujitsu.com>
  2012-08-27  7:23 ` [PATCH 3/5] media:dvb:fix up ENOIOCTLCMD error handling Wanlong Gao
@ 2012-08-27  7:23 ` Wanlong Gao
  2012-09-13  4:03   ` Laurent Pinchart
  1 sibling, 1 reply; 6+ messages in thread
From: Wanlong Gao @ 2012-08-27  7:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: Wanlong Gao, Laurent Pinchart, Mauro Carvalho Chehab, linux-media

At commit 07d106d0, Linus pointed out that ENOIOCTLCMD should be
translated as ENOTTY to user mode.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: linux-media@vger.kernel.org
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
---
 drivers/media/video/omap3isp/ispvideo.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/video/omap3isp/ispvideo.c b/drivers/media/video/omap3isp/ispvideo.c
index b37379d..2dd982e 100644
--- a/drivers/media/video/omap3isp/ispvideo.c
+++ b/drivers/media/video/omap3isp/ispvideo.c
@@ -337,7 +337,7 @@ __isp_video_get_format(struct isp_video *video, struct v4l2_format *format)
 	fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
 	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
 	if (ret == -ENOIOCTLCMD)
-		ret = -EINVAL;
+		ret = -ENOTTY;
 
 	mutex_unlock(&video->mutex);
 
@@ -723,7 +723,7 @@ isp_video_try_format(struct file *file, void *fh, struct v4l2_format *format)
 	fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
 	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
 	if (ret)
-		return ret == -ENOIOCTLCMD ? -EINVAL : ret;
+		return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
 
 	isp_video_mbus_to_pix(video, &fmt.format, &format->fmt.pix);
 	return 0;
@@ -744,7 +744,7 @@ isp_video_cropcap(struct file *file, void *fh, struct v4l2_cropcap *cropcap)
 	ret = v4l2_subdev_call(subdev, video, cropcap, cropcap);
 	mutex_unlock(&video->mutex);
 
-	return ret == -ENOIOCTLCMD ? -EINVAL : ret;
+	return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
 }
 
 static int
@@ -771,7 +771,7 @@ isp_video_get_crop(struct file *file, void *fh, struct v4l2_crop *crop)
 	format.which = V4L2_SUBDEV_FORMAT_ACTIVE;
 	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &format);
 	if (ret < 0)
-		return ret == -ENOIOCTLCMD ? -EINVAL : ret;
+		return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
 
 	crop->c.left = 0;
 	crop->c.top = 0;
@@ -796,7 +796,7 @@ isp_video_set_crop(struct file *file, void *fh, struct v4l2_crop *crop)
 	ret = v4l2_subdev_call(subdev, video, s_crop, crop);
 	mutex_unlock(&video->mutex);
 
-	return ret == -ENOIOCTLCMD ? -EINVAL : ret;
+	return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
 }
 
 static int
-- 
1.7.12


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/5] video:omap3isp:fix up ENOIOCTLCMD error handling
  2012-08-27  7:23 ` [PATCH 4/5] video:omap3isp:fix " Wanlong Gao
@ 2012-09-13  4:03   ` Laurent Pinchart
  2012-09-13 10:21     ` Wanlong Gao
  2012-09-15 16:24     ` Mauro Carvalho Chehab
  0 siblings, 2 replies; 6+ messages in thread
From: Laurent Pinchart @ 2012-09-13  4:03 UTC (permalink / raw)
  To: Wanlong Gao; +Cc: linux-kernel, Mauro Carvalho Chehab, linux-media

Hi Wanlong,

Thanks for the patch.

On Monday 27 August 2012 15:23:15 Wanlong Gao wrote:
> At commit 07d106d0, Linus pointed out that ENOIOCTLCMD should be
> translated as ENOTTY to user mode.
> 
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
> Cc: linux-media@vger.kernel.org
> Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> ---
>  drivers/media/video/omap3isp/ispvideo.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/video/omap3isp/ispvideo.c
> b/drivers/media/video/omap3isp/ispvideo.c index b37379d..2dd982e 100644
> --- a/drivers/media/video/omap3isp/ispvideo.c
> +++ b/drivers/media/video/omap3isp/ispvideo.c
> @@ -337,7 +337,7 @@ __isp_video_get_format(struct isp_video *video, struct
> v4l2_format *format) fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
>  	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
>  	if (ret == -ENOIOCTLCMD)
> -		ret = -EINVAL;
> +		ret = -ENOTTY;

I don't think this location should be changed. __isp_video_get_format() is 
called by isp_video_check_format() only, which in turn is called by 
isp_video_streamon() only. A failure to retrieve the format in 
__isp_video_get_format() does not really mean the VIDIOC_STREAMON is not 
supported.

I'll apply hunks 2 to 5 and drop hunk 1 if that's fine with you.

> 
>  	mutex_unlock(&video->mutex);
> 
> @@ -723,7 +723,7 @@ isp_video_try_format(struct file *file, void *fh, struct
> v4l2_format *format) fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
>  	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
>  	if (ret)
> -		return ret == -ENOIOCTLCMD ? -EINVAL : ret;
> +		return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
> 
>  	isp_video_mbus_to_pix(video, &fmt.format, &format->fmt.pix);
>  	return 0;
> @@ -744,7 +744,7 @@ isp_video_cropcap(struct file *file, void *fh, struct
> v4l2_cropcap *cropcap) ret = v4l2_subdev_call(subdev, video, cropcap,
> cropcap);
>  	mutex_unlock(&video->mutex);
> 
> -	return ret == -ENOIOCTLCMD ? -EINVAL : ret;
> +	return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
>  }
> 
>  static int
> @@ -771,7 +771,7 @@ isp_video_get_crop(struct file *file, void *fh, struct
> v4l2_crop *crop) format.which = V4L2_SUBDEV_FORMAT_ACTIVE;
>  	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &format);
>  	if (ret < 0)
> -		return ret == -ENOIOCTLCMD ? -EINVAL : ret;
> +		return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
> 
>  	crop->c.left = 0;
>  	crop->c.top = 0;
> @@ -796,7 +796,7 @@ isp_video_set_crop(struct file *file, void *fh, struct
> v4l2_crop *crop) ret = v4l2_subdev_call(subdev, video, s_crop, crop);
>  	mutex_unlock(&video->mutex);
> 
> -	return ret == -ENOIOCTLCMD ? -EINVAL : ret;
> +	return ret == -ENOIOCTLCMD ? -ENOTTY : ret;
>  }
> 
>  static int

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/5] video:omap3isp:fix up ENOIOCTLCMD error handling
  2012-09-13  4:03   ` Laurent Pinchart
@ 2012-09-13 10:21     ` Wanlong Gao
  2012-09-15 16:24     ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 6+ messages in thread
From: Wanlong Gao @ 2012-09-13 10:21 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-kernel, Mauro Carvalho Chehab, linux-media

On 09/13/2012 12:03 PM, Laurent Pinchart wrote:
> Hi Wanlong,
> 
> Thanks for the patch.
> 
> On Monday 27 August 2012 15:23:15 Wanlong Gao wrote:
>> At commit 07d106d0, Linus pointed out that ENOIOCTLCMD should be
>> translated as ENOTTY to user mode.
>>
>> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
>> Cc: linux-media@vger.kernel.org
>> Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
>> ---
>>  drivers/media/video/omap3isp/ispvideo.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/media/video/omap3isp/ispvideo.c
>> b/drivers/media/video/omap3isp/ispvideo.c index b37379d..2dd982e 100644
>> --- a/drivers/media/video/omap3isp/ispvideo.c
>> +++ b/drivers/media/video/omap3isp/ispvideo.c
>> @@ -337,7 +337,7 @@ __isp_video_get_format(struct isp_video *video, struct
>> v4l2_format *format) fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
>>  	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
>>  	if (ret == -ENOIOCTLCMD)
>> -		ret = -EINVAL;
>> +		ret = -ENOTTY;
> 
> I don't think this location should be changed. __isp_video_get_format() is 
> called by isp_video_check_format() only, which in turn is called by 
> isp_video_streamon() only. A failure to retrieve the format in 
> __isp_video_get_format() does not really mean the VIDIOC_STREAMON is not 
> supported.
> 
> I'll apply hunks 2 to 5 and drop hunk 1 if that's fine with you.

Fine, I defer to your great knowledge in this.

Thanks,
Wanlong Gao


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/5] video:omap3isp:fix up ENOIOCTLCMD error handling
  2012-09-13  4:03   ` Laurent Pinchart
  2012-09-13 10:21     ` Wanlong Gao
@ 2012-09-15 16:24     ` Mauro Carvalho Chehab
  2012-09-19  0:33       ` Laurent Pinchart
  1 sibling, 1 reply; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2012-09-15 16:24 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Wanlong Gao, linux-media

Em Thu, 13 Sep 2012 06:03:21 +0200
Laurent Pinchart <laurent.pinchart@ideasonboard.com> escreveu:

> Hi Wanlong,
> 
> Thanks for the patch.
> 
> On Monday 27 August 2012 15:23:15 Wanlong Gao wrote:
> > At commit 07d106d0, Linus pointed out that ENOIOCTLCMD should be
> > translated as ENOTTY to user mode.
> > 
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
> > Cc: linux-media@vger.kernel.org
> > Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> > ---
> >  drivers/media/video/omap3isp/ispvideo.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/media/video/omap3isp/ispvideo.c
> > b/drivers/media/video/omap3isp/ispvideo.c index b37379d..2dd982e 100644
> > --- a/drivers/media/video/omap3isp/ispvideo.c
> > +++ b/drivers/media/video/omap3isp/ispvideo.c
> > @@ -337,7 +337,7 @@ __isp_video_get_format(struct isp_video *video, struct
> > v4l2_format *format) fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
> >  	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
> >  	if (ret == -ENOIOCTLCMD)
> > -		ret = -EINVAL;
> > +		ret = -ENOTTY;
> 
> I don't think this location should be changed. __isp_video_get_format() is 
> called by isp_video_check_format() only, which in turn is called by 
> isp_video_streamon() only. A failure to retrieve the format in 
> __isp_video_get_format() does not really mean the VIDIOC_STREAMON is not 
> supported.
> 
> I'll apply hunks 2 to 5 and drop hunk 1 if that's fine with you.
> 

Not quite sure how to tag it at patchwork... I guess I'll mark it as "accepted",
as, from what I understood, Laurent partially accepted it, and will be adding
on his tree.

Regards,
Mauro

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/5] video:omap3isp:fix up ENOIOCTLCMD error handling
  2012-09-15 16:24     ` Mauro Carvalho Chehab
@ 2012-09-19  0:33       ` Laurent Pinchart
  0 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2012-09-19  0:33 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Wanlong Gao, linux-media

Hi Mauro,

On Saturday 15 September 2012 13:24:37 Mauro Carvalho Chehab wrote:
> Em Thu, 13 Sep 2012 06:03:21 +0200 Laurent Pinchart escreveu:
> > On Monday 27 August 2012 15:23:15 Wanlong Gao wrote:
> > > At commit 07d106d0, Linus pointed out that ENOIOCTLCMD should be
> > > translated as ENOTTY to user mode.
> > > 
> > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
> > > Cc: linux-media@vger.kernel.org
> > > Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> > > ---
> > > 
> > >  drivers/media/video/omap3isp/ispvideo.c | 10 +++++-----
> > >  1 file changed, 5 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/drivers/media/video/omap3isp/ispvideo.c
> > > b/drivers/media/video/omap3isp/ispvideo.c index b37379d..2dd982e 100644
> > > --- a/drivers/media/video/omap3isp/ispvideo.c
> > > +++ b/drivers/media/video/omap3isp/ispvideo.c
> > > @@ -337,7 +337,7 @@ __isp_video_get_format(struct isp_video *video,
> > > struct
> > > v4l2_format *format) fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
> > > 
> > >  	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
> > >  	if (ret == -ENOIOCTLCMD)
> > > 
> > > -		ret = -EINVAL;
> > > +		ret = -ENOTTY;
> > 
> > I don't think this location should be changed. __isp_video_get_format() is
> > called by isp_video_check_format() only, which in turn is called by
> > isp_video_streamon() only. A failure to retrieve the format in
> > __isp_video_get_format() does not really mean the VIDIOC_STREAMON is not
> > supported.
> > 
> > I'll apply hunks 2 to 5 and drop hunk 1 if that's fine with you.
> 
> Not quite sure how to tag it at patchwork... I guess I'll mark it as
> "accepted", as, from what I understood, Laurent partially accepted it, and
> will be adding on his tree.

Yes I'll add a modified version to my tree.

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-19  0:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1346052196-32682-1-git-send-email-gaowanlong@cn.fujitsu.com>
2012-08-27  7:23 ` [PATCH 3/5] media:dvb:fix up ENOIOCTLCMD error handling Wanlong Gao
2012-08-27  7:23 ` [PATCH 4/5] video:omap3isp:fix " Wanlong Gao
2012-09-13  4:03   ` Laurent Pinchart
2012-09-13 10:21     ` Wanlong Gao
2012-09-15 16:24     ` Mauro Carvalho Chehab
2012-09-19  0:33       ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox