Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp686767pxa; Thu, 27 Aug 2020 12:59:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMq70efC/LVChrBC96WJVduDH5eWqGFxmIA3S9SAB4yVGKUPWfD0OE1a98mQSsKcDvqsxG X-Received: by 2002:a05:6402:154b:: with SMTP id p11mr20592808edx.256.1598558345924; Thu, 27 Aug 2020 12:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598558345; cv=none; d=google.com; s=arc-20160816; b=rG6uymXToLjBgdqMq9fgYaFXetKg1kAlTimLlvut5efDk4kf1KnTYLZUYNmWH275es TAmuXRIo0YMJP68bIAwrx9rKluBTYBuUBqf04HRF6PPwxABk5e7N/0T7Hty5sygkG793 1hwoNmy3TuV7viNuVweb7QFbL/iiU4IX/T4XCmhO45l+qbPp0WJjST5afRBqJtTynXrZ +sQw98uoA3YG0yjqHLMgOy4gJAsLp6uIEb+tW4kkYefIfTSzNt96vXGekexnL0JmoCrV szbkz7sbzla6jElEBNhi0osPeSW1eI18gaSHsrvCTJLBaIOSP3PwCh3ee2uvZFz/th2M lnpA== 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=YLa56i743GyYyvzZsbp7wDSdWi+EGIOQBt69Q105LwQ=; b=eDO4LEHKqMRJsBZKnwMbGohrZX2Bvz/ZAX8gCz3oUdxzbwj9A7aEfI5Pg+xaaPVJmY 4C3ecbp8rAQ3gDi3EMbxb4xvb1rublquHBSTFtCYrS7p+XKxbEq9B181RPLw+S6QzPG9 TxCzVkMwRCPlkHFYoS6kC17W1ehUC3o0fR2VcL6brZDrDhxQjUThE8B3Of/T2vHOBZZH ch2r0+CIFFANzrH6fSQzTcJ/c5MFIitZrknMlXIJnGq7faqfHw9tPDfUrPnCJSgbO8Vl mZcmNHPFzWx/KBcaNFlYL3nvPpRNWKMafnmO2R9qt4zeFF9nNzm6ej/ls4ZkomeHvVwW ilng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SR0DcGiR; 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 y22si644608edu.130.2020.08.27.12.58.42; Thu, 27 Aug 2020 12:59:05 -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=SR0DcGiR; 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 S1727116AbgH0T4I (ORCPT + 99 others); Thu, 27 Aug 2020 15:56:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726246AbgH0T4I (ORCPT ); Thu, 27 Aug 2020 15:56:08 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3C80C061264; Thu, 27 Aug 2020 12:56:07 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id p11so4321135pfn.11; Thu, 27 Aug 2020 12:56:07 -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=YLa56i743GyYyvzZsbp7wDSdWi+EGIOQBt69Q105LwQ=; b=SR0DcGiRNSloexRgT5hNz4a+LfcqsIQj20wgCxHugcf+XgWQvmGFw0bnb0I7KbH+/c ogmXVcx8dsIt5IUDS/nGPWPBDatpaPAfM4P20TV5kzuntmfkhHwjvY9r9zW/CV8eKDUc oyYKZqYPt8LQaH829LamjzKyYe8CKpA8OZQMHcTyINmYvBZQ4Df4AnE1g6asyOOpkfCD TLQ5THGMgBFl8C5iKS2IuJ5aKQKMbHXw2v1y9jSF9m0qwPaLjYSjfuAZwAOemI2Rj0bw NMvemTfF1vk0wlIrV2GWv254XcKVuSD1++6tqd8PyFVcEvx3nMHuigVsvGKhuYalkxEc wSqA== 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=YLa56i743GyYyvzZsbp7wDSdWi+EGIOQBt69Q105LwQ=; b=GJZP0fEp/v4KuWgi1S0LBWM6TDZ39NwvE0HqE2DIXIA2nOEtWnyAYAJRXUYMwoMxBn SwRs48DpaoIoAs8OUfDIH+l6irGYZIP3ZHAnaC1su4tGWzM50vq+KAfRZ6R00P05/6L1 FJn8YwF+UE7I55duIQmN5YMj1CluMbCvAy5r1kpxDJjQNuxW8sdERJZ5p1pQK2VKHvUZ j//zp5gkrTYH+KZ4Y32Lyf9NSjRVitrqidhSkQ9mPEbxiVmrvrJzHl54KFUVKlzZOxZ/ v3eD6juKNbZerQJh8psdmEk3x744B5FQslPQop8UzFNQhHDn9YvSYjxlyGb04aXD//UZ Ukfw== X-Gm-Message-State: AOAM532OMH4EZhm44HPBRrn5KrSD5vOvYVdkd4gvaTexz4aaoMJusfD1 WUbK2av6/12fW9MjeKhnljbGCGsq2lmHGwoDngg= X-Received: by 2002:a63:ec18:: with SMTP id j24mr15250227pgh.74.1598558167388; Thu, 27 Aug 2020 12:56:07 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-12-krzk@kernel.org> In-Reply-To: <20200827192642.1725-12-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 22:55:51 +0300 Message-ID: Subject: Re: [PATCH v2 12/18] iio: dac: dpot-dac: 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 > --- > drivers/iio/dac/dpot-dac.c | 16 ++++++---------- > 1 file changed, 6 insertions(+), 10 deletions(-) > > diff --git a/drivers/iio/dac/dpot-dac.c b/drivers/iio/dac/dpot-dac.c > index be61c3b01e8b..2258535b8a42 100644 > --- a/drivers/iio/dac/dpot-dac.c > +++ b/drivers/iio/dac/dpot-dac.c > @@ -183,18 +183,14 @@ static int dpot_dac_probe(struct platform_device *pdev) > indio_dev->num_channels = 1; > > dac->vref = devm_regulator_get(dev, "vref"); > - if (IS_ERR(dac->vref)) { > - if (PTR_ERR(dac->vref) != -EPROBE_DEFER) > - dev_err(&pdev->dev, "failed to get vref regulator\n"); > - return PTR_ERR(dac->vref); > - } > + if (IS_ERR(dac->vref)) > + return dev_err_probe(&pdev->dev, PTR_ERR(dac->vref), > + "failed to get vref regulator\n"); > > dac->dpot = devm_iio_channel_get(dev, "dpot"); > - if (IS_ERR(dac->dpot)) { > - if (PTR_ERR(dac->dpot) != -EPROBE_DEFER) > - dev_err(dev, "failed to get dpot input channel\n"); > - return PTR_ERR(dac->dpot); > - } > + if (IS_ERR(dac->dpot)) > + return dev_err_probe(&pdev->dev, PTR_ERR(dac->dpot), > + "failed to get dpot input channel\n"); > > ret = iio_get_channel_type(dac->dpot, &type); > if (ret < 0) > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko