linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ricardo Ribalda <ribalda@chromium.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	tfiga@chromium.org
Cc: Ricardo Ribalda <ribalda@chromium.org>,
	Hans Verkuil <hans.verkuil@cisco.com>
Subject: [PATCH 3/4] media: uvcvideo: Return -EACCES for Wrong state error
Date: Thu,  9 Sep 2021 17:00:45 +0200	[thread overview]
Message-ID: <20210909150046.57615-4-ribalda@chromium.org> (raw)
In-Reply-To: <20210909150046.57615-1-ribalda@chromium.org>

For error 2 (Wrong state) return -EACCES instead of -EILSEQ.
EACCES is a much more appropriate error code. EILSEQ will return
"Invalid or incomplete multibyte or wide character." in strerror(),
which is a *very* confusing message.

Suggested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/usb/uvc/uvc_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index dfea967309f2..8423941cfc95 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -108,7 +108,7 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
 	case 1: /* Not ready */
 		return -EBUSY;
 	case 2: /* Wrong state */
-		return -EILSEQ;
+		return -EACCES;
 	case 3: /* Power */
 		return -EREMOTE;
 	case 4: /* Out of range */
-- 
2.33.0.153.gba50c8fa24-goog


  parent reply	other threads:[~2021-09-09 15:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 15:00 [PATCH 0/4] Follow-up patches for uvc v4l2-compliance Ricardo Ribalda
2021-09-09 15:00 ` [PATCH 1/4] media: uvcvideo: uvc_ctrl_is_accessible: check for INACTIVE Ricardo Ribalda
2021-09-09 15:00 ` [PATCH 2/4] media: uvcvideo: improve error logging in uvc_query_ctrl() Ricardo Ribalda
2021-09-09 15:00 ` Ricardo Ribalda [this message]
2021-09-09 15:00 ` [PATCH 4/4] media: uvcvideo: Do not return positive errors " Ricardo Ribalda
2021-11-11 20:41 ` [PATCH 0/4] Follow-up patches for uvc v4l2-compliance James Hilliard
2021-11-11 20:52   ` Ricardo Ribalda
2021-11-11 21:22     ` James Hilliard
2021-11-11 21:27       ` Ricardo Ribalda
     [not found]         ` <CADvTj4r_SzChXj04Ddn6PPUDN7QnKczm6MJXeES-uUUQx3ds+Q@mail.gmail.com>
2021-11-12 10:09           ` Ricardo Ribalda
2021-11-12 10:45             ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210909150046.57615-4-ribalda@chromium.org \
    --to=ribalda@chromium.org \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tfiga@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).