Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1648607rwb; Sun, 2 Oct 2022 05:28:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BlYOQFTefZfk0dtlURnjRC5LbuRwb6VFZE6IZ5Hz4ZRibl8jBEVj/y6mwuTx/P6efrerp X-Received: by 2002:a65:4d46:0:b0:43b:e00f:8663 with SMTP id j6-20020a654d46000000b0043be00f8663mr14735567pgt.147.1664713736474; Sun, 02 Oct 2022 05:28:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664713736; cv=none; d=google.com; s=arc-20160816; b=FqLDZxfCC0WH2kv4qgDaLGHVUJuo2BNzn+I7SYsrkn7W7WbxPNfGR7yXPngRac54G3 xtf485u+Lm3GMYrG/NU9osvrhFAS2JD9Mgj0JqTnqSWisK7FC+sD+ys30SoKVJ9nFeQC 064M4RjuvdM6vcOTyslyEbslXoUCjBPbha28hxzhI9wYGcXD8laCh2eAffPXXD1T9O16 78kQ77gFb3TtKrZxpMOeSwOj4M/VHHihWgly4GMolJUY6sh5OJbiAJc4h5jUc/e/VOKQ UGl/4dFbYx51ZSfDw7FeY2ciVK6hlh8NiUU7OWJrQQVF9t8InOsfLBciJiw3G7Sw1x1d m7fA== 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:subject:cc:to:from:date :dkim-signature; bh=P9dwt902U3yUDyzReHGyj5SAu8LXLDLvy5MqSkrMTJ4=; b=FRW0eJ69IGYEQmU2Q+TwGsxSKikREDHpXt0P9u7Em9knrJ7cA4GgI6+sYB0dHZGOgP sTuFXt3x5/b57S64rqIHjth4QQvUWcSgdBBBnFs2jqAeIO18LF0lPojDQNoru/vAmWPE ZCEGHJh/YniJcuaWae+IvqYecsRyLwro69QM4zxNFmtIOGoVWGZJBivsLSCgHlk205zu 5S51zXH09qUMcfOMTqWSJJnzXXcWDBjpJaEjNw4qhLkjXfUwXJRM+bIwWqDUe9jQ4+7I +vJkMks+UI+3pbN5Z4qJUEWSuSJn2JznSRbFbNllAaIMcarD/t840QWqGeLUifNeFRPG s4TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=asq1FbO9; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c14-20020a170903234e00b0016f9420a15asi5986218plh.168.2022.10.02.05.28.45; Sun, 02 Oct 2022 05:28:56 -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=@kernel.org header.s=k20201202 header.b=asq1FbO9; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229509AbiJBLOt (ORCPT + 99 others); Sun, 2 Oct 2022 07:14:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229640AbiJBLOp (ORCPT ); Sun, 2 Oct 2022 07:14:45 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92D32BC31; Sun, 2 Oct 2022 04:14:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 9F10ACE09B0; Sun, 2 Oct 2022 11:14:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D4F8C433C1; Sun, 2 Oct 2022 11:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664709279; bh=Moiaee8arCDFyQsCc3cTgcJnzrt3XyvzVkJjg2EP4JE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=asq1FbO9nWd6LIVD/DpGc14Ui2DLc9LQrHmlhR+ozyoNocjnYuOkqyBzt/+Gd7wli dGuwCaCouZ0SanZDusNUZ3k3pLVxerpZv26LBW5AsHbujhF0WrDjuwf2ic2KGKl8VT iZC6b6saRUcTlezAjD4VLL5qxAPT8slIWJCyuvLf8a5/DG4ecRP03W9quz5EMg0hUG dk2N2XWchj7Jh94jKreXtD1GDGVLkwn92qpjfEhZYSrNRPudVWLFTuYdWFbnwhk7XS k1JZrfJMyOC5gV1giYZh5eAvpdWPOhrmyply5GB0s8bRNdE5pHsj7UBGIHUNxLMfNQ NOsvKZH5mTlBw== Date: Sun, 2 Oct 2022 12:14:54 +0100 From: Jonathan Cameron To: Matti Vaittinen Cc: Andy Shevchenko , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Nikita Yushchenko , Cosmin Tanislav , Jagath Jog J , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, "Mutanen, Mikko" , "Haikola, Heikki" Subject: Re: [RFC PATCH 4/5] iio: accel: Support Kionix/ROHM KX022A accelerometer Message-ID: <20221002121454.18ff80b2@jic23-huawei> In-Reply-To: References: <20220922180339.30138141@jic23-huawei> <3eea7954-3faf-3fc9-7507-c318488c5524@gmail.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Wed, 28 Sep 2022 19:23:06 +0300 Matti Vaittinen wrote: > Hi Andy, > > On 9/28/22 17:06, Andy Shevchenko wrote: > > On Wed, Sep 28, 2022 at 02:14:14PM +0300, Matti Vaittinen wrote: > >> On 9/22/22 20:03, Jonathan Cameron wrote: > >>> On Wed, 21 Sep 2022 14:45:35 +0300 > > > > ... > > > >>>> + dev_err(dev, "no regmap\n"); > >>> > >>> Use dev_err_probe() for all dev_err() stuff in probe paths. > >>> It ends up cleaner and we don't care about the tiny overhead > >>> of checking for deferred. > >> > >> This one bothers me a bit. It just does not feel correct to pass -EINVAL for > >> the dev_err_probe() so the dev_err_probe() can check if -EINVAL != > >> -EPROBE_DEFER. I do understand perfectly well the consistent use of > >> dev_err_probe() for all cases where we get an error-code from a function and > >> return it - but using dev_err_probe() when we hard-code the return value in > >> code calling the dev_err_probe() does not feel like "the right thing to do" > >> (tm). > >> > >> Eg, I agree that > >> return dev_err_probe(dev, ret, "bar"); > >> is nice even if we know the function that gave us the "ret" never requests > >> defer (as that can change some day). > >> > >> However, I don't like issuing: > >> return dev_err_probe(dev, -EINVAL, "bar"); > > > > This case specifically was added into documentation by 7065f92255bb ("driver > > core: Clarify that dev_err_probe() is OK even w/out -EPROBE_DEFER"). > > Yes. And this is exactly what I meant with: > >> Eg, I agree that > >> return dev_err_probe(dev, ret, "bar"); > >> is nice even if we know the function that gave us the "ret" never > requests > >> defer > > There is still (in my opinion) a significant difference if we call: > >> return dev_err_probe(dev, -EINVAL, "bar"); > > - where we really hard-code the -EINVAL as a parameter to the > dev_err_probe() > > >> Well, please let me know if you think the dev_err_probe() should be used > >> even in cases where we hard code the return to something... > > > > And this should be, of course, maintainer's decision. > > Ultimately, yes. I'm not that fussed. So happy to accept code taking either view where it is hard coded in the call like this. I'd love a dev_err() that took and returned the error value though just for all those single lines of code saved. J > > Best Regards > --Matti >