Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp872179pxk; Thu, 10 Sep 2020 00:14:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwROsZUgbr5tum9kQIcDsIWiabx6JS68VG0sR/0dLVQnhhQzacYfdrDOILenJJF5z3HPr5T X-Received: by 2002:a50:9355:: with SMTP id n21mr7627698eda.237.1599722061215; Thu, 10 Sep 2020 00:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599722061; cv=none; d=google.com; s=arc-20160816; b=ybg1K/ymT4r10/JenNguwOxQXxWsclXMDrkEfUuel3QE+iiKESCiUtZOeETP3H23xl JtqNOGffw8klkmxNn9zw9Gh8zndFiOp3i82c2Cx1wjptRMclEfdt6g1bpyQO2dW+ZQse 22QgUqmo1ouo6XU1eyLd6erbqPOqqtEJKSR/LYyqBtI2qL0/AcU25W7zPgI66a+BieGT EIC2BU8lThR9zsRsOrOnKO/wowAkqS5kZjPlFyRIJoXgiqR7qocZsD9jR+Jpb7KWRJtX Ipxbrs+1lDZ1dGhKDPGbgdgzVBkj5QJbiXXBVfrfA21J9KMmDOK0BHiUvcrEKLN9+gu3 /pcA== 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=WW1E9uWNh55CMAyx/KZGndtw6t2MyESMU1RmrczrPRo=; b=xgZmiBPGfuVOxXd2RQYZnBy3paxaVx1lo+1djFnrpqxrsStEc7H4lcctqa3fPPyrmH Yr+4QeK6hkgS9DyUrbhNmLnkFDA0wfvr3f9OhxYsJ5soD1SJeHw1SZ59JJEBLYbMDTwO 4XnHE2a6cJ++eGl4IqaWesgUW4iDrqSWk5Qn4CqUwcneo3XLMS1Ja7au6yNdMGkgvwwe 2eCqnbQAop3uZnrbBRu4aNlBd072Iuf4GT0QfmLB+8uW/WGjoWyAMol8nzZ0DpjeYZZP w6uIsft1c4pePvddNyGYZq/nwoUwmTXV3RyP/Y7DhwuuwwYo7kTBTy/nJYqds2lEfKQa Vtew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gXL+ijTB; 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 u18si3183328ejf.75.2020.09.10.00.13.58; Thu, 10 Sep 2020 00:14:21 -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=gXL+ijTB; 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 S1730261AbgIJHNR (ORCPT + 99 others); Thu, 10 Sep 2020 03:13:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:35040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730021AbgIJG7L (ORCPT ); Thu, 10 Sep 2020 02:59:11 -0400 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 D585821D40; Thu, 10 Sep 2020 06:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599721151; bh=xOzDDEuhcg0+WXu//QXZGuTvH72fhH7NrPswesxiZA8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gXL+ijTBw11FfLjLqyYUZfKHTa4Zvs2N1LU7JLoiGcBQ7DNHaV/PzX6MCoDp00EAp wlCG83HzbzCGx6nVtzWC2pIby9quHCEjEIqQec3QmfPoutTorFkcOj+v+bXRg2MhHa jwCRShpKk3NeYVaSR0bdXRVGBByi3LEGRCE3M3wI= Received: by mail-ej1-f54.google.com with SMTP id r7so7071637ejs.11; Wed, 09 Sep 2020 23:59:10 -0700 (PDT) X-Gm-Message-State: AOAM530WBIRzWslzlsBcuGP2kDBY0deZMa9dTEbWrs4Th51duXFWR8HV UG88jKwJDE3Dr0BsAM36V7dWEf6+3rDs6rqwgNE= X-Received: by 2002:a17:907:724f:: with SMTP id ds15mr7191226ejc.119.1599721149291; Wed, 09 Sep 2020 23:59:09 -0700 (PDT) MIME-Version: 1.0 References: <20200829064726.26268-1-krzk@kernel.org> <20200829064726.26268-8-krzk@kernel.org> <20200909193600.41970d8c@archlinux> In-Reply-To: From: Krzysztof Kozlowski Date: Thu, 10 Sep 2020 08:58:57 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 08/18] iio: adc: stm32: Simplify with dev_err_probe() To: Andy Shevchenko Cc: Peter Rosin , Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Michael Hennerich , Marek Vasut , Tomasz Duszynski , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-samsung-soc@vger.kernel.org" , "linux-amlogic@lists.infradead.org" , "linux-stm32@st-md-mailman.stormreply.com" , Greg Kroah-Hartman 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 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. >> > >> > 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. Best regards, Krzysztof