Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp909736pxk; Thu, 10 Sep 2020 01:40:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9ScilB8qAXRE1lYmgvzsTiNY/+Vm3Y8TSDBZoBklKVsvU81Gn9NCOuns3GoAhwGGqyoXp X-Received: by 2002:a50:cd5d:: with SMTP id d29mr8482169edj.318.1599727200214; Thu, 10 Sep 2020 01:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599727200; cv=none; d=google.com; s=arc-20160816; b=iOi4aIcmokCIrRq/KWoqvYjmZINlYV2P8WWATry06l0/zzO/njdZhgal2Tcldb98oy iyUqFpVTAqX9obOodegyS5HGogpzlABfJJeET/WYDeHPOhJ4/+BFwIkPwbwgk58kjthG 6H+h2rCo4yGsaeg65npruZq9Bp33ituu1BLniE2Es1ZcXV503gus/a0mRFkNMBAPUMW9 KD+3PoIx7DQi24DyK/Zqr5JQOzdgqBHpjSiRwe9k/jG2GhCfEbY0ZBDfhreNCMvTqpmM uembmb0JudC+dHh2ET2g1s6yu1u6hQYu930WQhAoXMs92HnlMzmeBDI7FGZUeTZHOClV m00g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=z8kbT62uOD/+MBDA/eAaZLyMFterLNLuHFMKx9xqpHY=; b=FmlWqfFw4RBw2kDdHobKWAH2lHjpjdytIj8KdtZOEnjz2q6TYGpQ7cmgy4UkjaUZwE i4w6T4SQQzZMqqPhvwnJqvzwXC60EReA1TCdPH0IO8y83dkyb2bqmiwbux4fGrSY/Ilj 5S4lDmkTFLkInOuCbVtm20avhG+Fet50lyD9dbnpab5JujgT79PU7gsUXOerM/Ff4+au I/5UTwv091DzKOGV/r0hgA//lMP6rshBCpzOWPHX9Bz3d7O6B9ArAHlvbJVHpn0OdahB d5NONboi+zRTH8NbXbdqRG6pCdf1t4TZIuYg6fkLtM+hu9wURQ2usG4FOmuYDrxOaoAM yKbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xShM8od5; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v15si2908773edw.67.2020.09.10.01.39.36; Thu, 10 Sep 2020 01:40:00 -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=@kernel.org header.s=default header.b=xShM8od5; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730245AbgIJIis (ORCPT + 99 others); Thu, 10 Sep 2020 04:38:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:55792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730498AbgIJIgx (ORCPT ); Thu, 10 Sep 2020 04:36:53 -0400 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3EC2A20770; Thu, 10 Sep 2020 08:36:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599727012; bh=FTig6rPaZltKUx3M9pM1ycw/aGv4o3ffuusmSgumDhI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=xShM8od5RQmoImiTHhOxlMyzg9o3ljBugN4a2iBHXy0Z2ekwWv3uBFmyvtisw6ts1 9ua5wSzxOQGjLK8n1jw65HT2a5t327eRPtroSOFd4/mnPnzor9N2j2F5ueX9IXzQqg 7z1VW1nyh9Oc5r6RQbLV2cuuT9DFnJ0lyOAZRp4I= Received: by mail-ej1-f50.google.com with SMTP id i22so7503482eja.5; Thu, 10 Sep 2020 01:36:52 -0700 (PDT) X-Gm-Message-State: AOAM533otwDkPUZTJ7vhgiATyqLU2p8YMQA3YJC5/iH4tfuIMSAFVS8y cpJmvCewDCuU1gvtlmoL6Z6IGYQ9wpcSUz3gXEg= X-Received: by 2002:a17:906:4046:: with SMTP id y6mr8123139ejj.148.1599727010714; Thu, 10 Sep 2020 01:36:50 -0700 (PDT) MIME-Version: 1.0 References: <20200829064726.26268-1-krzk@kernel.org> <20200829064726.26268-8-krzk@kernel.org> <20200909193600.41970d8c@archlinux> <20200910091208.000055fa@Huawei.com> In-Reply-To: <20200910091208.000055fa@Huawei.com> From: Krzysztof Kozlowski Date: Thu, 10 Sep 2020 10:36:39 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 08/18] iio: adc: stm32: Simplify with dev_err_probe() To: Jonathan Cameron Cc: Andy Shevchenko , Lars-Peter Clausen , Tomasz Duszynski , Michael Hennerich , "linux-iio@vger.kernel.org" , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , Marek Vasut , "linux-samsung-soc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Peter Meerwald-Stadler , "linux-amlogic@lists.infradead.org" , Peter Rosin , Jonathan Cameron Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Sep 2020 at 10:13, Jonathan Cameron wrote: > > 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. Yes, I see, Peter pointed this out. The commit was actually not dropped from next so I will send a fixup. Best regards, Krzysztof