Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3977520rwb; Tue, 20 Sep 2022 07:16:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6x7EX+wsd5dgCBre4ftmND0KQ/BDRfInkoZ7PDGFMUCRsiJo39YvUPLUo3wb75ZaAJTAXO X-Received: by 2002:a05:6402:1d48:b0:44e:c6cf:778 with SMTP id dz8-20020a0564021d4800b0044ec6cf0778mr20945079edb.421.1663683402334; Tue, 20 Sep 2022 07:16:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663683402; cv=none; d=google.com; s=arc-20160816; b=A6kMdPnHcRRQ/38clq3l8FwDRgPMl+qcvizgx5Cd3FTfnZqyStIsSNQzZGxcoZnwu5 jHckm51g58PqiRFg73zxNqUj2dqMNgsamqMqnK9NSxEWyKI5zzzZPs+1cqKsu/ZL2j6X 9iZ5hr9ZVFPh9Bbz7R8uM0vAR3bpAU2uPlyspCz2VHuV9/nTc+n2r1h/JYHIbgUCEaTh 6xEPxCdqNb+wfuEflWBSiJwhBH0I6ut08i4eowtnYSNXPFKlf+dkcRwzNZ4eZ02zYa6f agufWK1CXN5eFMSvqDkBxlTTAmFKAEDX12CuqLyokMiLHjjjYzPWAMsfFgODawQmpGsq AajA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=fZx/rWrR7bth2k3zX90922HeFwXDXF4+XRCwzM0uxDU=; b=yjKDU8HC1HW5dx2PMcUHwdKnZFm2QWAqc3rVt9xf6UrlECct6xVnAFUNjhpCInY0Hr tx2Cyppyu7/PCRLZxh2JRfCAs/FBrYFOtv87/OKW2O9Fiz/A9efivhZgwLdw8hqNMJVU Qnbjr4oJC8Uro3Ac5GFh6DNgr7BbZI5JNIIYUmN7BSUgmse9KLOYage4oxb8SJMd+HCd VP7x/gFOhQ4KojoAHYYDE55vC+XRBZz9M7Ld3yFnrlfk6HRtBFZkdpeHyN85yUSQsF0o H0K1y7keMKbAzAS3HA2nMCf1J+B0+fJDnjxlMnlt9sydtwD4bvtTPSDE5THML8VdU3UD Z8tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hNs3RX9x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf37-20020a1709077f2500b0073dcb2ec4d2si1520122ejc.889.2022.09.20.07.16.13; Tue, 20 Sep 2022 07:16:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hNs3RX9x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231768AbiITONl (ORCPT + 99 others); Tue, 20 Sep 2022 10:13:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231455AbiITONH (ORCPT ); Tue, 20 Sep 2022 10:13:07 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80C942CDD1 for ; Tue, 20 Sep 2022 07:11:24 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id lc7so6621529ejb.0 for ; Tue, 20 Sep 2022 07:11:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date; bh=fZx/rWrR7bth2k3zX90922HeFwXDXF4+XRCwzM0uxDU=; b=hNs3RX9xQGVD65f7QO8VzrP4znwu+FGcrbo6ocv7O/05gKBZ1wH41NfT1tMoB9JKK+ fCnEJGtdMDBVBXb1GRcqA66h+89xj3KHTLcreDEUobgVWQilew9i+jzjGMKG1tG/c+ds QX40CW1oeB2mxfZTxSz0tD36imknHdZUK16b0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date; bh=fZx/rWrR7bth2k3zX90922HeFwXDXF4+XRCwzM0uxDU=; b=rDFpIwoRZSC569+slJvUwADsuYnMtGsSyt8oDMlHUJkFxP9YanERuxXmwkChUQTftV GorB/ac76F8iIT+NNG/hazGNd7UNIjbPc+cKOiyaVGE+EwTYS2V7/yn121P1m3sCrVNP OLc7VM64zX47ZV/JVSwFPKbRc9JaBbJfKxlcJbQR2hW/t58L0R5CZm5t3LVud+s80hpo VEbE6+dfkoYichmBbZrGs67zQdKhsO/4UX19sqkOTpsQxvW8FTXvrlU3+L7PUs/k6Tk7 c1yWihV+LIOW6kCnUoC28W4dx0SnpF9ErGvNo9I6f8CgziT0SJXyCXHHIChuEFcFTlKx pjzA== X-Gm-Message-State: ACrzQf0CJn2i991DI47oCcClhk9O/7XMwym5Ee3M6D1J6cVGIjfOB8Uk eYZfmpZRLPqayA7o7qJkNemaB9NNr7KbcLOeOR8= X-Received: by 2002:a17:906:8a6b:b0:780:ab37:b63 with SMTP id hy11-20020a1709068a6b00b00780ab370b63mr15122776ejc.365.1663683082739; Tue, 20 Sep 2022 07:11:22 -0700 (PDT) Received: from alco.roam.corp.google.com ([2620:0:1059:10:935d:52b0:7461:88e1]) by smtp.gmail.com with ESMTPSA id b24-20020aa7c918000000b004518ee90b4dsm129668edt.1.2022.09.20.07.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 07:11:21 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 20 Sep 2022 16:11:06 +0200 Subject: [PATCH v1 3/5] media: uvcvideo: Return -EACCES for Wrong state error MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20220920-resend-v4l2-compliance-v1-3-81364c15229b@chromium.org> References: <20220920-resend-v4l2-compliance-v1-0-81364c15229b@chromium.org> In-Reply-To: <20220920-resend-v4l2-compliance-v1-0-81364c15229b@chromium.org> To: Mauro Carvalho Chehab , Laurent Pinchart Cc: Hans Verkuil , Ricardo Ribalda , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.11.0-dev-d93f8 X-Developer-Signature: v=1; a=openpgp-sha256; l=854; i=ribalda@chromium.org; h=from:subject:message-id; bh=l3Tve8hGJ5W5tTbag9O5QNFnAI00qvVi1fN45JRNTAM=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjKcn/J5h+0gj3RkVXT+F2wF6DERtyqXPbiyyPS7Lq 01rqx+2JAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCYynJ/wAKCRDRN9E+zzrEiHQTD/ 9ZBbIC//geY3g3ywDr6Lg3j0lkU5m5cFuiwGpZL3bDLnUZKL3tB9cmqFZQ/7+/DdRcS1r4tAb0rsWq 1XHhHIc+sM7TEzcdm57ZzhYfopuV/68vfB6OJCwS92xPqfL162Ra/Hw75GVS0MNrF+xX6US6MnnUYX BD8XtqNgRvMb878fj3jVT1cpI7wqY5wYEGOh5hg672qjO5lnXBiJJDNJ9dFxA5Y32sqBqPdjde+d4x 317Wit7YVtGnscLOwtnJquHVHK1mlclPv17aZXGiT5ja23aONAmSilXyZ9gIq1SSYOD5b9mLl7/Fx9 B49LiMIqk/Bu0pgLxrfG7lWNJDpjwoosiCKyMjwDemlX4IH2xutfvtoJbE9C5X1FnR0Z/k5WgLXG1n Gi/qwNnme0/qaxzH8LtckCv03PgDdT8F0Z7hCXHH/kHIlkbJxfbz4PYloO0xVKyrAzB/28t90eylny xX7q5sDFzaEGFATiPrPHgxRbMNG5JO9BadznggBkBEHsPqMEfPVvAkOTNxyyKxLpg1dKVluB+dgUDw b6BPlBIUw9vE5vdRn2Soq7bVPLR+DffaYnFgF75zjjWTZrurbo2BKwvRjxJkfLQKfmbmYC7FD6JrvK sorGg3tmm1lsqmx2Eqki3JvDotU44SzDJgR9u6d61m2hvOpy7ypTvYvG/CEw== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 Signed-off-by: Ricardo Ribalda 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