Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp604486pxb; Thu, 9 Sep 2021 08:03:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydEh7VNN07q8UeraEUjnpwQCohkIc4uxaUBTpp+D8qtY3bY8mFkHW8p6+TUmF+8e3Ffhhg X-Received: by 2002:a5d:9e49:: with SMTP id i9mr3038780ioi.125.1631199797518; Thu, 09 Sep 2021 08:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631199797; cv=none; d=google.com; s=arc-20160816; b=p6fdGO+nS3ifTG0xqsS7knRDg330vRWjNxpe+cxdWD4b0BS7WXkP8tY7MfVv/hvDYl PUgzpWi3yVVQ6FIYZ9UXC5d5MNDLcntPNiTyRsjQbjI29UvUDkuD09Uy2ev9YkwmHPOn fZKoXh8B+bVCo/oC2PcHd5IPbSvVI5t9Jw77EvZKBLd2SCcumpSUIrgNFwe8r+aT/Vj9 YxmEOAVS2pfKkznO6GqJziHizuQdmuLwSTQUxJ84uDDTYMCXfKrGDWACWwPDh0Tu7My4 ev/bE5gU+nEFHpzSkNr277t27ZjY9vy+GT7/S5TxVW3jwXoFnfy0OaFSMsxCrxtMReUi WEiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PFa3KJ/BqHh5hC+Ov9xT5eV0V5cc5CCGELgN2fPTVp0=; b=a6jgMl+q38GinAnq9c6AFbj4u3Wtw/nYegKsrQFHdaVVyaqTsV23+HJWFP5NmQ21Pl 3uh+ZvDELF3ui+e9fvtP9tlVNHIn5X2HD9LfOoqQvZ2+csfycLUe9K0Lfr54aaUvK2VP OQOpu5rlS426WBjJuKnmtYM3hkCcAyqbA9mapYxEY9fJugMuaWwHT3DfzzSfPq0mGH1e Krf8aGJrQc2IYlTJY+WzElM5VtTQ1pZveDqf14OGAR38QGTjgTHUTbZDxXeA5SsSWjol uyOElHJgOgZSq7Aur+VxLDnxIsMfWdv/VqTnkhzrDCQT/JBYPnqOaoFwx5jA0xAtSuEM GJpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jbhHCUQj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si1827554ilc.6.2021.09.09.08.02.48; Thu, 09 Sep 2021 08:03:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jbhHCUQj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S236039AbhIIPCg (ORCPT + 99 others); Thu, 9 Sep 2021 11:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239434AbhIIPCL (ORCPT ); Thu, 9 Sep 2021 11:02:11 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14F9CC06178A for ; Thu, 9 Sep 2021 08:00:53 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id 9so3054946edx.11 for ; Thu, 09 Sep 2021 08:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PFa3KJ/BqHh5hC+Ov9xT5eV0V5cc5CCGELgN2fPTVp0=; b=jbhHCUQjc2diNmHYzs9tbDzI97+sRa1m/MSxSz5EBAExSlhEilTdoS3b/J610OmToi QahEcOeeiNaStZafdlezPWS7bcqcAXu3WN3Rv14vg05MfUHchIY+alnfn2rz7aWvyEnm bKKFZcP4qLJKWy0fd6THt0vFFeGVSQQnQBt2s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PFa3KJ/BqHh5hC+Ov9xT5eV0V5cc5CCGELgN2fPTVp0=; b=XyJB6BOZnJAB9PGLxq3AOHh4UlueskdITPhPvSQ042WIvBroLwvIjvZl6HBTOEDcD+ 5GbY/xMXpRp88FIVW/HWp+Y+XrK1sv65ATaFRABrk1JZCP5zcP+enErisospiFqM1rbh njhR80zqZY67JZKd0nmjhd1jKEPgcIA2piDtdgvykgrr8xRdngaCRiJWgOCgzaFGMuiK omapK7pWbrioqg53z9kf6uOS+0Vp8WNmwRIGDve0+bOX0gk0L1g57yMNlwSkRCbB45o/ ZWQhz0USyNBDNXiconZ9cfc55Nl1rH+1Vzc+FfZtsMujpdHBWEDcVZvM2SLBJEu5n3i8 TMuQ== X-Gm-Message-State: AOAM533C99W4NowpP5XQTMsRBpfZCN++akX1XKKKyZ+L563/y+qNAyv0 YbS1ugaBjqJR2eToIw1/s4Jctg== X-Received: by 2002:a05:6402:c90:: with SMTP id cm16mr3671319edb.170.1631199651678; Thu, 09 Sep 2021 08:00:51 -0700 (PDT) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id h8sm1139644ejj.22.2021.09.09.08.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 08:00:51 -0700 (PDT) From: Ricardo Ribalda To: Laurent Pinchart , Hans Verkuil , Mauro Carvalho Chehab , Sergey Senozhatsky , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org Cc: Ricardo Ribalda , Hans Verkuil Subject: [PATCH 3/4] media: uvcvideo: Return -EACCES for Wrong state error Date: Thu, 9 Sep 2021 17:00:45 +0200 Message-Id: <20210909150046.57615-4-ribalda@chromium.org> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog In-Reply-To: <20210909150046.57615-1-ribalda@chromium.org> References: <20210909150046.57615-1-ribalda@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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