Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp581792lqp; Fri, 5 Apr 2024 02:46:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWLCKtBlAmGiXCCjyUCwWGphwzn3opEiQp61y6lnheYkKSQ8x72U4YCTiLi6EIrP4lI4JV9aWeKJVQkNfJcWqyIHOikbKwgI5o/XRVr2Q== X-Google-Smtp-Source: AGHT+IGyzJ/8rYp80STlQnpfJX/37u111/eB1HZFOuRmcsO9IUBYOAxkvafHxa092ct2PU8O1fBB X-Received: by 2002:a05:6a20:3cab:b0:1a5:6d13:2afc with SMTP id b43-20020a056a203cab00b001a56d132afcmr1237693pzj.11.1712310379457; Fri, 05 Apr 2024 02:46:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712310379; cv=pass; d=google.com; s=arc-20160816; b=PP6ZfB7N/jL/FwKX9y8V74HtxWSxvNRD3WVw8skOwn2JMxCjFuS+UYMC2vIvkWI+2b H2FTpNkYy80ZiQde/osFresME8R9RUGmSm9AeVCW76L6ftLwNe2gameERyRc7Du+DrBd 2B1Qb/9y83M+IZosOFRLlR2rIvBe0ndcAObY1nUPrcgi9ByUzIxYeW1RfOMLNPbmFbWu aeFJSmyi5OKxzkJgb8uODJxOYnHrYNjrR893H9VBlYasTEw1I+zjb2drom4Ih1URgRox B5C5kjr2XXLgL0dU4HyRTeIuE4BsgZR6pZd/4+J2xQIyJAjMlRVvLqD3ZjnWoQlXern/ Y9Mw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=2+rgU/jLfZs7L7z8Q6KNlD9i0CZ9Z9iPF7LcXW7Y+gs=; fh=yN6RTFifyvpPYoxoPW4BhtVFWJVIf9uU/M1pWiSun3U=; b=Pzbvrq0t7p58O5ZxcjpHe2/4+khp7iAYojVkUVO0rX2KeuN6KmiddKPepE/8wolEPo +nQCx7GJ31l/2srUvBiaXkeIFVx/hD4kVHLZYR29HvqkD6EDj1++yZkKwayxWyZN2zhU iyyLXLL+MgbelxF0S4+DmCkYGYiTlv9yPblz6nMdp2TusKe1RWeyvvPMic858aGFEDNn nAHQV38XfMghX8wzmQ31MIqe5Sx//wq3O+AdjjK7MLpcd0CK5+6iJaDw8z+2mQtBpIck huHZV5kNAAwtxSXC/0+D/mRQSz2YeodQfiLT7JDf6NZcpGDEcjjhKiGtY+86qfnSk2tS A1/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-132758-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id jd3-20020a170903260300b001dffdf223d4si1038370plb.105.2024.04.05.02.46.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:46:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132758-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-132758-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F3AFD284372 for ; Fri, 5 Apr 2024 09:46:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CEA65160862; Fri, 5 Apr 2024 09:46:11 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DBA51474DC; Fri, 5 Apr 2024 09:46:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712310371; cv=none; b=PTMa3XlPPk+ouVtRRqUSqjd9NWYC3iNNQsj4/KEzhOWoKYBlQgdE27HDEB8GgfhocyJFPWpDWt2Y1L2doHy2BvAcirkLjlGwXDjPN59nfsltWr9mRX1UPiNIBQ7MRVxH7rNicX0wJSsELE2tdyGnLFkImTv+WuGsdJ/TTo7wi9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712310371; c=relaxed/simple; bh=N/ilJYPULnziC1IDqUT0V88hxfBEu9DOsd7q2tbFgn8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LVq7xQ6Dca7GdhI+pMqKBZr1mjbnpqdoOBc4oqINPijzhZQYyI98JNPmVuJYXrrg7JCoaWpPWUG2yAK7aPfststfjLU2Jf3rmQIhsVuRPjLSfBLVyKP2NWwG7NSwLk3Ep3s5DSPwEx/Auw7s2PubEfQZuMoaU3fC7KKzJqts808= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1D534FEC; Fri, 5 Apr 2024 02:46:39 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4AF6A3F64C; Fri, 5 Apr 2024 02:46:07 -0700 (PDT) Date: Fri, 5 Apr 2024 10:46:04 +0100 From: Sudeep Holla To: Andy Shevchenko , Linus Walleij Cc: Peng Fan , Sudeep Holla , "Peng Fan (OSS)" , "brgl@bgdev.pl" , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "cristian.marussi@arm.com" Subject: Re: [PATCH] pinctrl: pinconf-generic: check error value EOPNOTSUPP Message-ID: References: <20240401141031.3106216-1-peng.fan@oss.nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Apr 05, 2024 at 02:13:28AM +0000, Peng Fan wrote: > Hi Andy, > > > Subject: Re: [PATCH] pinctrl: pinconf-generic: check error value EOPNOTSUPP > > > > On Thu, Apr 04, 2024 at 01:44:50PM +0200, Linus Walleij wrote: > > > On Mon, Apr 1, 2024 at 4:02 PM Peng Fan (OSS) > > wrote: > > > > > > > From: Peng Fan > > > > > > > > The SCMI error value SCMI_ERR_SUPPORT maps to linux error value > > > > '-EOPNOTSUPP', so when dump configs, need check the error value > > > > EOPNOTSUPP, otherwise there will be log "ERROR READING CONFIG > > SETTING". > > > > > > > > Signed-off-by: Peng Fan > > > (...) > > > > ret = pin_config_get_for_pin(pctldev, pin, &config); > > > > /* These are legal errors */ > > > > - if (ret == -EINVAL || ret == -ENOTSUPP) > > > > + if (ret == -EINVAL || ret == -ENOTSUPP || ret == > > > > + -EOPNOTSUPP) > > > > > > TBH it's a bit odd to call an in-kernel API such as > > > pin_config_get_for_pin() and get -EOPNOTSUPP back. But it's not like I care > > a lot, so patch applied. > > > > Hmm... I would like actually to get this being consistent. The documentation > > explicitly says that in-kernel APIs uses Linux error code and not POSIX one. > > Would you please share me the documentation? > +1, I am interested in knowing more about this as I wasn't aware of this. > > > > This check opens a Pandora box. > > > > FWIW, it just like dozen or so drivers that needs to be fixed, I prefer to have > > them being moved to ENOTSUPP, rather this patch. > > I see many patches convert to use EOPNOTSUPP by checking git log. > > And checkpatch.pl reports warning for using ENOTSUPP. > Exactly, I do remember changing ENOTSUPP to EOPNOTSUPP based on checkpatch suggestion. So either the checkpatch.pl or the document you are referring is inconsistent and needs fixing either way. -- Regards, Sudeep