All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Ribalda <ribalda@chromium.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>,
	Ricardo Ribalda <ribalda@chromium.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v1 3/5] media: uvcvideo: Return -EACCES for Wrong state error
Date: Tue, 20 Sep 2022 16:11:06 +0200	[thread overview]
Message-ID: <20220920-resend-v4l2-compliance-v1-3-81364c15229b@chromium.org> (raw)
In-Reply-To: <20220920-resend-v4l2-compliance-v1-0-81364c15229b@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>

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index 2cf7f692c0bb..497073a50194 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 */

-- 
b4 0.11.0-dev-d93f8

  parent reply	other threads:[~2022-09-20 14:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20 14:11 [PATCH v1 0/5] [RESEND] Follow-up patches for uvc v4l2-compliance Ricardo Ribalda
2022-09-20 14:11 ` [PATCH v1 1/5] media: uvcvideo: uvc_ctrl_is_accessible: check for INACTIVE Ricardo Ribalda
2022-09-20 14:11 ` [PATCH v1 2/5] media: uvcvideo: improve error logging in uvc_query_ctrl() Ricardo Ribalda
2022-09-20 14:11 ` Ricardo Ribalda [this message]
2022-09-20 14:11 ` [PATCH v1 4/5] media: uvcvideo: Do not return positive errors " Ricardo Ribalda
2022-09-20 14:11 ` [PATCH v1 5/5] media: uvcvideo: Fix handling on Bitmask controls Ricardo Ribalda

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=20220920-resend-v4l2-compliance-v1-3-81364c15229b@chromium.org \
    --to=ribalda@chromium.org \
    --cc=hans.verkuil@cisco.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.