Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp689152pxa; Thu, 27 Aug 2020 13:02:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXi5/4dKMr8Xjsj1hDLYxYHV1xGO8dFJS9AqBFvuLSH8DuQdjlRcb1MxQoIi1b88hKTdWZ X-Received: by 2002:a17:906:d97b:: with SMTP id rp27mr4843743ejb.18.1598558565163; Thu, 27 Aug 2020 13:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598558565; cv=none; d=google.com; s=arc-20160816; b=mkhuI1loJ+GkaTZLrkhM4pTxCb03g7LmgJUp2Rv57MR+ew3Dz7Klo72Hzii9hGVlz2 ps81fhbaKXwNj4xyLqvGjIWScjuwV3Vob4encI8Xh06DGw7wRzbrAwT7DmT3/XppPVDM Oea17craXQV7rij/mNlSA17s2ICSr4GdQqw5mMAdYTB6vr9mgRho0bjVjadAe2Aq0eK/ R35XqrHyKAqZn1fhqqvHTVjPxgQPqdqT3H51oRVjKrkou3jDIsrJLSLRtUKDtgBl6TbG el4QEnvHsaqEVd1vEbB5ZOeaqWMbBjk2ReVhiJrkznMA4bVHzTHn3xVsz7RGWpPcTR37 0Jew== 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=6PibWI1WPUcSBuRxCpQduFOuzkYtMaBM/7TN/dC+YiE=; b=k0vdpQilVE3TFbTGu/AM3vIET5ZjFIRZ+3FabH0hXT3b0Y8ECwo7HwJDvla/N+93pW 85yqt/npp0zUcOkExBRJgMqMsVIRtoa+fFfiB/9CoRUepwWqRgRhXCVw8iFj5hschxAF 3xKOOUEtkp/lFws/OneqTD42ogyEp6ODxYAq5O84ImuUS4VFdGflHPazLtN5lwYRC9I+ GyOGHLL97PuACzO+hISwIQqpvOpPf3HN9NKqcQaCRufjfIqRIK74vHtldRbkFrIwZo0X 3ThgvoH5fa6oo6ZejAOQ6MQX2iWzxz9zV/9jtLapgWk06yEJ4YFcIao8DO22/eIX2onB 2V7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b7gOG6wg; 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 b24si2089806edv.245.2020.08.27.13.02.22; Thu, 27 Aug 2020 13:02:45 -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=b7gOG6wg; 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 S1727017AbgH0UA5 (ORCPT + 99 others); Thu, 27 Aug 2020 16:00:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726120AbgH0UA5 (ORCPT ); Thu, 27 Aug 2020 16:00:57 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6CB0C061264; Thu, 27 Aug 2020 13:00:56 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id 31so4108595pgy.13; Thu, 27 Aug 2020 13:00:56 -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=6PibWI1WPUcSBuRxCpQduFOuzkYtMaBM/7TN/dC+YiE=; b=b7gOG6wgCzT8BP986bm1kkzzFNR5NMwx61bMRrJN7WECwQlCKbLJ0mj+ASuG3rLlY6 sqRQr5z+Q5tmBHLiaNmXtpOJF/m8HhJKOC0N3BnLyEbvLECd9gi43KZGF2mLOy/Fx4eF agm1klSih22rh2dQo7IKSSeLNshpUwc1PCIvsvcCgIR4zda8EF+aBJ++duzL8wRoYBRC lV+0tCCiFNxVlpGSz7CUbjh0RX+LcmJ5edho3Lr1QZwtUFcqdZGWYHGcG5ZsUTsQWcFN mA0KZnlMJH3puC9gFYa7jPr92KVbp1OjVTWGkYZ+h+qUcWiPSjgBhwkVisWpkBweIh4Z T5ww== 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=6PibWI1WPUcSBuRxCpQduFOuzkYtMaBM/7TN/dC+YiE=; b=Hgc/B/u/oJU7b5temJ8sEsxInv1lkofBzDPuGAnJxRndyf8E2zApjOgpt9t7B+skPq 99gWNhNUo/YFCWo/6QRvd+SAR9ROHakiRKdle9vSWmtIf1yWjkqRshd4Vufqi5YpAb0K jNXnymRT1L8m0JnnTIrnrdjioBcGlfqnilKtRtzDEbZ6QefgzTU7zpXwRntEK4uS0w/x JzVno2xisBvH+2kLLwpmmb2qHRQ/J2gMLm279UfD8WbVxMIjLRtLsG7RccErWjVVamFC /D6J44IKcwlShiKPB/gyC1HNcxNvo+3KHhKVwG39ktZjNI8o7PQF2iMJdSI5s8TrQlNc sEIw== X-Gm-Message-State: AOAM532DiADWclD/C2ClxJv8ytBzYrFScQJbXmL7gjI7fm3/SWIqw8h+ ccqJAjPd4tO4TgqtYu50rJOmhI2PZ6Vz/fqHats= X-Received: by 2002:a62:9215:: with SMTP id o21mr6817717pfd.268.1598558456196; Thu, 27 Aug 2020 13:00:56 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-15-krzk@kernel.org> In-Reply-To: <20200827192642.1725-15-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 23:00:39 +0300 Message-ID: Subject: Re: [PATCH v2 15/18] iio: light: tsl2772: Simplify with dev_err_probe() To: Krzysztof Kozlowski Cc: Jonathan Cameron , 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 , 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:29 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/light/tsl2772.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c > index 735399405417..d79205361dfa 100644 > --- a/drivers/iio/light/tsl2772.c > +++ b/drivers/iio/light/tsl2772.c > @@ -1776,14 +1776,8 @@ static int tsl2772_probe(struct i2c_client *clientp, > ret = devm_regulator_bulk_get(&clientp->dev, > ARRAY_SIZE(chip->supplies), > chip->supplies); > - if (ret < 0) { > - if (ret != -EPROBE_DEFER) > - dev_err(&clientp->dev, > - "Failed to get regulators: %d\n", > - ret); > - > - return ret; > - } > + if (ret < 0) > + return dev_err_probe(&clientp->dev, ret, "Failed to get regulators\n"); > > ret = regulator_bulk_enable(ARRAY_SIZE(chip->supplies), chip->supplies); > if (ret < 0) { > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko