Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp685162pxa; Thu, 27 Aug 2020 12:55:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz03xPB5oQ9RJCFLLzYSl0UL4Ls0U6DIFLu24S4C+SYpy79haXQdYtdNAf49HNsreiGbrUt X-Received: by 2002:a17:906:5f8f:: with SMTP id a15mr23872003eju.291.1598558157547; Thu, 27 Aug 2020 12:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598558157; cv=none; d=google.com; s=arc-20160816; b=REUt6Ok3MR9ml7D62ZR5tf4WgU72XUl3NKFQinb7vm/4SgacUS1ujS6AyeuKsDQ9cm AJWzxVIU+WoEEAzzlI6UzJUD22dpaoMOTDSH9iS3ME0vZ4MicLNw122u2E3eTR8gTStb Hn6oLnJ6nTYXyKXfDQVmrk64KwY+xyX5DhzLbAKThosaSmx6L/EtXRuH9g8y/iUZvsR7 XtEfH7goaKeM0zSIDNjHzfTUChtySUAKCng4wrwzu1yAdggb3VBsyJx2ydN17gsk/awr 7U2CQtfiyec11Mx+UpWDFwIlByx3DDmrw7Rx6oa0EQnzOGCTZTVH6Wg61SzEP70kERdx e58g== 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=1iCBP+9jZBWChmw6UiUb37gEZ3nyFFfurQpHrGXgKOo=; b=USAqZE71CX7iGb+IrltyJMPFTXhMZ6OW3NvEJ3Wgy266WaicjJ/o8rrPFm/zaFP2SE tTWLUfVWE79V5ZCq/mNZ9xICIqpJCgX7Ce4Lfa7J598L/T/j0/FjAiq3ASUYcdK79Rr9 RWLvw6ZCUdIHvAvdfPXuIl+VBdOfdmWjV7wTAjg2OEd8ZKx/68Pl3MFgmBem3AIqk55/ Ozhuexj+zD49H4t2++Gt88wVN4FxSld5YjWKq8C2STdoyW5Svz1H0fOMzHLMAvO17fq9 MU05hF9cCsEG3ajHHEv09AWbrk/nlIQpTimoYRp6TK/gW9XYO8rgoEdy+92JlN1Kd8N3 KLoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fmDKpG7J; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zm12si1972888ejb.696.2020.08.27.12.55.34; Thu, 27 Aug 2020 12:55:57 -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=@gmail.com header.s=20161025 header.b=fmDKpG7J; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726323AbgH0TzC (ORCPT + 99 others); Thu, 27 Aug 2020 15:55:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726120AbgH0TzC (ORCPT ); Thu, 27 Aug 2020 15:55:02 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2A53C061264; Thu, 27 Aug 2020 12:55:01 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id q93so3097114pjq.0; Thu, 27 Aug 2020 12:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1iCBP+9jZBWChmw6UiUb37gEZ3nyFFfurQpHrGXgKOo=; b=fmDKpG7JsNZWYR4WnBcEBetb/oHsOCdtX523ndIe2IZMPYsIrBIKn1XtshfI4TqHwu D08AXB8uTUFH9zriG8lI0eNgDKRlaSQ9a+EWr/izTx93LB42f1p07HwFExW+QrUgdzyd ilaVRZ8+BDgLBgmCDQoEuZoEJTPlFaZWucf3rXVXkqEzzE9MpG9unIWKWpgco9V4FBG8 CPvCh+d3lPSpQGZwMLm0Rg+2Ygk4XldfIOOPsXF+p9+3iCHmyKGE8aFMr8pYT4nRCAqb eEVyijsnhpi5gSlqNea/keX3CLEEgpzZulaCr/n7I8TIfrBd63KA70brURiKiTw0S43y LaEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1iCBP+9jZBWChmw6UiUb37gEZ3nyFFfurQpHrGXgKOo=; b=OTouiZdUMlMdua/+D3F1QppcmWZXJWcXolzUWgXqgRBURmecDks8WpBfiutGxd/stY ZGUd7gPKzXqQEYS3LU2ctmNrkL7g5RGpJS8vSsBSnj5LyCdbz2ffTE6MgmUvegJAVO7R 7XI9FWPGzfTEVMxKm3+ve4l6tB25hPaU3AboTyUnMfMKMvJGyhzBVcWEIRgYQd8Xs/CG FN3PmaWq0oVUNULU/xpSRK8OYLBRXIiD3iepamVEPrEYIgBbzknSerYQ1A11LVOa2h9q Q5kzFHTjE2eziR+8Uwf0gNZnq6vDAMG90IlyZpc8hjJSQpV/c/nKwmVGTT1HQqUFKvDf A6LQ== X-Gm-Message-State: AOAM533hTnFbC91GA88e3BSKLBo4kFJTTLO2Vqz9K2dEbeTPpKmdPrgE ylgpHRCGAey8WjzPWMSlgSdyPcUxJNtB8s++wi0= X-Received: by 2002:a17:90a:2c06:: with SMTP id m6mr418944pjd.129.1598558101205; Thu, 27 Aug 2020 12:55:01 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-9-krzk@kernel.org> In-Reply-To: <20200827192642.1725-9-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 22:54:45 +0300 Message-ID: Subject: Re: [PATCH v2 09/18] iio: afe: iio-rescale: Simplify with dev_err_probe() To: Krzysztof Kozlowski Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , linux-iio , Linux Kernel Mailing List , linux-arm Mailing List , linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com 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, Aug 27, 2020 at 10:28 PM 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. Reviewed-by: Andy Shevchenko > Signed-off-by: Krzysztof Kozlowski > > --- > > Changes since v1: > 1. Wrap dev_err_probe() lines at 100 character > --- > drivers/iio/afe/iio-rescale.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/iio/afe/iio-rescale.c b/drivers/iio/afe/iio-rescale.c > index 69c0f277ada0..8cd9645c50e8 100644 > --- a/drivers/iio/afe/iio-rescale.c > +++ b/drivers/iio/afe/iio-rescale.c > @@ -276,11 +276,8 @@ static int rescale_probe(struct platform_device *pdev) > int ret; > > source = devm_iio_channel_get(dev, NULL); > - if (IS_ERR(source)) { > - if (PTR_ERR(source) != -EPROBE_DEFER) > - dev_err(dev, "failed to get source channel\n"); > - return PTR_ERR(source); > - } > + if (IS_ERR(source)) > + return dev_err_probe(dev, PTR_ERR(source), "failed to get source channel\n"); > > sizeof_ext_info = iio_get_channel_ext_info_count(source); > if (sizeof_ext_info) { > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko