From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4264CC433E2 for ; Thu, 10 Sep 2020 08:15:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CDE8820855 for ; Thu, 10 Sep 2020 08:15:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QuZ7+k96" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDE8820855 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=Huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ksT8XzfyyVarPo1LPOJlUiyFr9FQXjFzokTLeog6ABQ=; b=QuZ7+k96zk4xcQAreFtIM4aQw Vp5sDdmjkWJDEnF3ten0kr4MxU1yjrOmBbokodLJRzGld8YZihVVKI/IHgV501P5m/xCmf7c2mYfR ZopYLBzRe8zm/sR0Vk/Bavt7CI8a97Lxp53rd5ONubQGHBdRySBm6ej/s8mmt4vayqI91YjmhMTML +U6g/aFaL7g76eBdipVyW/tDAmmUZeErzhFwrUq9vDnk/CCixcdsjtGgaVRpjK/z6THEgK353udaK S1QAbDIZSWpUlwUhwE4f/R5WtUCTLgiSukIFLfbbvOzf/SL2LGuuYByxJpLgsydj+ElCHg8WXqGtm R7MdNnRMA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGHiP-0000YB-B1; Thu, 10 Sep 2020 08:13:57 +0000 Received: from lhrrgout.huawei.com ([185.176.76.210] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGHiF-0000Re-4H; Thu, 10 Sep 2020 08:13:50 +0000 Received: from lhreml710-chm.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id CCFBE850CD2915818418; Thu, 10 Sep 2020 09:13:43 +0100 (IST) Received: from localhost (10.52.121.43) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Thu, 10 Sep 2020 09:13:43 +0100 Date: Thu, 10 Sep 2020 09:12:08 +0100 From: Jonathan Cameron To: Krzysztof Kozlowski Subject: Re: [PATCH v3 08/18] iio: adc: stm32: Simplify with dev_err_probe() Message-ID: <20200910091208.000055fa@Huawei.com> In-Reply-To: References: <20200829064726.26268-1-krzk@kernel.org> <20200829064726.26268-8-krzk@kernel.org> <20200909193600.41970d8c@archlinux> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.52.121.43] X-ClientProxiedBy: lhreml712-chm.china.huawei.com (10.201.108.63) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200910_041348_301507_61F7607C X-CRM114-Status: GOOD ( 27.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lars-Peter Clausen , Peter Meerwald-Stadler , Michael Hennerich , "linux-iio@vger.kernel.org" , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Peter Rosin , Marek Vasut , Andy Shevchenko , "linux-samsung-soc@vger.kernel.org" , Jonathan Cameron , Tomasz Duszynski , "linux-amlogic@lists.infradead.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 10 Sep 2020 08:58:57 +0200 Krzysztof Kozlowski wrote: > On Thu, 10 Sep 2020 at 08:52, Andy Shevchenko wrote: > > > > > > > > On Thursday, September 10, 2020, Peter Rosin wrote: > >> > >> Hi! > >> > >> On 2020-09-09 21:57, Krzysztof Kozlowski wrote: > >> > On Wed, 9 Sep 2020 at 20:36, Jonathan Cameron wrote: > >> >> > >> >> On Sat, 29 Aug 2020 08:47:16 +0200 > >> >> Krzysztof Kozlowski wrote: > >> >> > >> >>> Common pattern of handling deferred probe can be simplified with > >> >>> dev_err_probe(). Less code and also it prints the error value. > >> >>> > >> >>> Signed-off-by: Krzysztof Kozlowski > >> >>> Reviewed-by: Andy Shevchenko > >> >>> > >> >> I don't have the thread to hand, but this tripped a warning next > >> >> and the patch was dropped as a result. See below. oops. That is what I get for reading an email very quickly then looking at the code a few hours later. Still a problem here we need to fix unless I'm missing something. > >> > > >> > Thanks for letting me know. If you mean the warning caused by: > >> > https://lore.kernel.org/lkml/20200909073716.GA560912@kroah.com/ > >> > then the driver-core patch was dropped, not the iio one: > >> > https://lore.kernel.org/linux-next/20200909074130.GB561485@kroah.com/T/#t > >> > > >> > So we are good here :) > >> > >> No, we are definitely not good. See below. That means "See below", and > >> not "Please take a guess at what is being talking about". > > > > > > > >> > >> >>> @@ -596,12 +594,9 @@ static int stm32_adc_core_switches_probe(struct device *dev, > >> >>> priv->booster = devm_regulator_get_optional(dev, "booster"); > >> >>> if (IS_ERR(priv->booster)) { > >> >>> ret = PTR_ERR(priv->booster); > >> >>> - if (ret != -ENODEV) { > >> >>> - if (ret != -EPROBE_DEFER) > >> >>> - dev_err(dev, "can't get booster %d\n", > >> >>> - ret); > >> >>> - return ret; > >> >>> - } > >> >>> + if (ret != -ENODEV) > >> >>> + dev_err_probe(dev, ret, "can't get booster\n"); > >> >> > >> >> This tripped a warning and got the patch dropped because we no longer > >> >> return on error. > >> > >> As Jonathan already said, we no longer return in this hunk. I.e., you have > >> clobbered the error path. > > > > > > Exactly my point why I proposed _must_check in the first place. > > That was not exactly that point as you did not mention possible errors > but only "miss the opportunity to optimize". Optimization is different > things than a mistake. In this particular case we have introduced a bug. If the regulator returns an error other than -ENODEV we will carry on when really should error out. This includes deferred probe route in which it won't print a message but also won't actually defer. Jonathan > > Best regards, > Krzysztof > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel