Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp688577pxa; Thu, 27 Aug 2020 13:01:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzczbDF7gOW1tgAgFDDMVg1cNvD3Wd8ZkdSMLv11ySPCVuKfrhA2NgY3s4xHgPHeW7CLEat X-Received: by 2002:a17:906:25c1:: with SMTP id n1mr23203117ejb.463.1598558518996; Thu, 27 Aug 2020 13:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598558518; cv=none; d=google.com; s=arc-20160816; b=EpInWrCJN9PFRUZdNlgzzVEC67DEte7huSveDRoQtQtb0r/VhAJn6jhpMTk5uH59eA SBCGOqLnlHx0XE3AQ5/5xSjH0jhHA2O6Eg6aDYK128lJBozWnKvtpnB0Ownps2iTEXOb UP9yd5/SSO6Vah4AHpmGRMEgCN6RbanwMoTugri9fAyNrRFcKp0NGfDHFd47VbQodQ+L 9IZsRXCF1A0pvI6VSrFtDsZDBmH14+S3LsK4ns/WC38Et4nEQ0D2juBD9il2QqvD4mRh HuNCWQnEEk0MItGCIhkcNy+a4v+UCaGI1MXqldte+RtXLMPjnfSlM2rnUwBfzVpmUtaK 7QsQ== 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=J7FsTR8MREGabBVt8LZ1j+20Xw6tV3sc64t+TrTmz1s=; b=mDG3ngU6XSvAb4RTMmUPWQSSEU7vdVC5KB86yvgFJNGZiT95Lec1yWH5HAjbq0mnBi p13qWZ+u2zzu2Q2U35tmLchVqlkafU5+umVMaB6e0+fu/KsMMAJNbg3dtuWod2gF8oCD S76lIDydf3JkTLwv18slzlaY+V0U1l/dFyk8172atTeobSICqXXQUkypu+GKXqVwznf4 Un6tijKjZUV1uPGVDKYtgeDKa/u5BqtsGzxjsJw0s5ClV03JEQ8VIgYAaQiVHIUnLzFm oYQu8aRfDFh+th7jx8toSRCwmnoO2WyeNhZ7i97SG5Ro79C7jtmtRPunigqzbn67uP3H f5IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H9Avjr9T; 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 m23si1978796ejk.621.2020.08.27.13.01.35; Thu, 27 Aug 2020 13:01:58 -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=H9Avjr9T; 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 S1727863AbgH0UAW (ORCPT + 99 others); Thu, 27 Aug 2020 16:00:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726120AbgH0UAV (ORCPT ); Thu, 27 Aug 2020 16:00:21 -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 74731C061264; Thu, 27 Aug 2020 13:00:21 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id k15so4321448pfc.12; Thu, 27 Aug 2020 13:00:21 -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=J7FsTR8MREGabBVt8LZ1j+20Xw6tV3sc64t+TrTmz1s=; b=H9Avjr9TBzYfwPOkz9EdvQOD/Hp2R/foNgj3n1RhDeUBaZ+T5lK3N+jmOVnF21fOPt cveijGliKTaLjmDGdxLWA8yVPczBusBiXh8fEduLfVMgyZ0AxHteuhJDmjK+uvJjLgPq hM8m0PARzvkixd1ZpgNhwBjSF1Ql6JaTzlrCF6hmmq+YjKNxQIvus1kjO8clKsH8C/t2 Nr82ezEM0MgwJqZL7nrR3nrQCfjaqM4GPuz/FwXoB+2fw+2pY2HJ58nma+QCs85J+WsJ mBjjdnKmcvQsh0zyRUoV3RFVkHHilb03CsDzzWN0tKOzpTSWidOkEcJRc4N+Npaqr7Eh iyLA== 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=J7FsTR8MREGabBVt8LZ1j+20Xw6tV3sc64t+TrTmz1s=; b=fbeD/6r7Vl27Y2IqIeZ6zvwNxmU23eLlH3MsoN/g240zWVGH/HGJIdL8f/BZ8WCEQt Yre5rFnP7qrynbF9l+8PxTN7t3r4wbX72Yr838hFTdf0xYzd9Mq269xUf54aQ/fT4VAv HFDEKIspaFNBhYTl53aFTT0qH6jnz/T+9a+02MsZyyTDUbEan0fvy5PMTu9R3YseKS22 7b0VCiOfXpwO3A9pn0Cf7Li+zsWUIVl/6g2zPhGAq9O8ARlShglQsKw2+JdZXACN00R9 LNUxHB33T4oNXukKMNK9iGU3ZeDgYEV7d7IOyKoVNNNtTImmb+fdBXOrPYZHqV/LcG9J Dx3A== X-Gm-Message-State: AOAM533NYVqpbWLiet/0R4FzWAJ3lUoatolrG/z6JjaHSN2ShDsdbXMs hTM3wEERTS+v849sJu4X8rLU4+wBnkai9vPLmDQ= X-Received: by 2002:a63:f24a:: with SMTP id d10mr15673608pgk.4.1598558421035; Thu, 27 Aug 2020 13:00:21 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-14-krzk@kernel.org> In-Reply-To: <20200827192642.1725-14-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 23:00:05 +0300 Message-ID: Subject: Re: [PATCH v2 14/18] iio: light: isl29018: 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: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/light/isl29018.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c > index ac8ad0f32689..2689867467a8 100644 > --- a/drivers/iio/light/isl29018.c > +++ b/drivers/iio/light/isl29018.c > @@ -746,12 +746,9 @@ static int isl29018_probe(struct i2c_client *client, > chip->suspended = false; > > chip->vcc_reg = devm_regulator_get(&client->dev, "vcc"); > - if (IS_ERR(chip->vcc_reg)) { > - err = PTR_ERR(chip->vcc_reg); > - if (err != -EPROBE_DEFER) > - dev_err(&client->dev, "failed to get VCC regulator!\n"); > - return err; > - } > + if (IS_ERR(chip->vcc_reg)) > + return dev_err_probe(&client->dev, PTR_ERR(chip->vcc_reg), > + "failed to get VCC regulator!\n"); > > err = regulator_enable(chip->vcc_reg); > if (err) { > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko