Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp680675pxa; Thu, 27 Aug 2020 12:48:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydEp87gkJ4aTWegNvM8HMi/OyLs+QNadyQZ8I9+yp8f0lF7rVuqCumXnsyM0wQo2I+nGQf X-Received: by 2002:a17:907:40bf:: with SMTP id nu23mr20141605ejb.47.1598557692743; Thu, 27 Aug 2020 12:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598557692; cv=none; d=google.com; s=arc-20160816; b=UQVhpuVm7hf8myq6Jestw0MytsTXKIgj7H+iHDXsq0xtsLzOjnTALWMePOf7DRxoW8 cI118eSqm91YxaJYQSmZB0hPkuRZLl0Teb+lv46iqEfUklDkdr1gpffYr2JzdIxUqq59 obURrT00utyfuIrETIUBN3tJgGj8ydsjiBMeEDfwL8M0tMipiU224idPDHwNWGzYbgcS kh2tK9ZUQi8geTegp+brCF8Ucq+XolSbwFbZIO+bl25V57LVJhaxMJi9SCjbwBTpo9wB /ityxAHIMiGzAS2gDSjJjuI7MEyoZ41tO7CK7FzeU73/Jp3X67Q7PYWVIX01RYlKAZGo S4fA== 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=DsY79qVdnz/yUX82ew80473wZLT4P/n0zA6vYZgLAJM=; b=dWjDMOlIutSwC1ZpvLNtAIfiQLJC902SB5zUK0ynOZC30rawD7goIwPIXl7/GJko0O pUiYAT/OXWpGOZHpdV4Ey/+JkLg/d8f7AKPJ0AiEptPl08Z5J7LBotLXxtRmoLJ+6kda VEVnua0r5XG97dPKnYnoJWksA/3FrWEGs1mS4aSlPNU4Ia0nkGlY7XUxAxY2L1St0SVM hMIwFPMeK30sj9W2yOlC0U7zorSAD2OqLZ4FDpLyZOPZ1p9yIOLRX78buUiaKGY2pKO+ keHXfiC6HwCG0doYeKsEgG/8I28qUX9IHsu8HKWqwfjA9m0P5OmL4Ky2xvM4o6tBMttf pC1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DDtkvONh; 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 p8si1985259ejz.594.2020.08.27.12.47.50; Thu, 27 Aug 2020 12:48:12 -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=DDtkvONh; 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 S1727794AbgH0TpY (ORCPT + 99 others); Thu, 27 Aug 2020 15:45:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726120AbgH0TpX (ORCPT ); Thu, 27 Aug 2020 15:45:23 -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 868F5C061264; Thu, 27 Aug 2020 12:45:23 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id g29so3084187pgl.2; Thu, 27 Aug 2020 12:45:23 -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=DsY79qVdnz/yUX82ew80473wZLT4P/n0zA6vYZgLAJM=; b=DDtkvONhdCDz2E15P3lgm4SUPfbidvJwyzD/KGMvJl5Uaj+BvEDrkhmpYeNcRP3WfK oeCzjEsz923anj2td9TkmoUrH3RirNTL6NWuMWq0c46s2akRNJn8ZAPOEqpgoqjBJkPm y6hj7W4fibWg/xEPwbt3AhH35mjnu/xsZjuu1f6kDcSjEjXYiDfNO18/BweXqDuXxcKJ 2Hb6RvXZRgyxit2KC8hOo/3C7HM0GmVNmCuoWM8SaWTggcxr0ZBg0vKXKKitWR3u7NwR BJnPeBZ3LIlM/+ygoHaKIGQVEDH/Qzy8Bj5vp/TzfG5iuAwRLoq7r93AR679Eirr4Svh fzVQ== 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=DsY79qVdnz/yUX82ew80473wZLT4P/n0zA6vYZgLAJM=; b=kYCb1EC0oUWhsD5qX30ZrA4H/+tV/eKg4Es0B+MCmlyHwfqMTQMHWZdRbbsjEA4RkF 2aBNBTIwfD32VKchPIaEttuTBfToXUMj3Ytv9khl6KNSbBq+pnJ/zgpgmSZ7mPHu4Pjn k/DjFW7X7oIkwzMqday98PBRboZxFA7qOelHFHYUFy9zDjShXEfez8hvgrglf4A/ep5r NgGU1Qc5K316g3ABsUKNL2d3aC10rykAp+wEoUpnFrzT6HPE1RDOS1IhFSJ2i06Q2b0o Pf9VyvSjsDzlizb/aJdzqXRU932d6fEatyT0H5nmKG8U0c/+3NR2V7tfd8oZIbVAFKTx Ul4g== X-Gm-Message-State: AOAM5313hCEHwGG5TRv9Z8svWJWD0sVf/0L4hogFbnr4lAgJ2amYvvrw MHwpemDW/xdTW0A+a+LcMCpnv5EX/ramLL/q2cM= X-Received: by 2002:a62:9215:: with SMTP id o21mr6773830pfd.268.1598557522910; Thu, 27 Aug 2020 12:45:22 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-2-krzk@kernel.org> In-Reply-To: <20200827192642.1725-2-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 22:45:06 +0300 Message-ID: Subject: Re: [PATCH v2 02/18] iio: accel: mma8452: 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:27 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/accel/mma8452.c | 20 ++++++-------------- > 1 file changed, 6 insertions(+), 14 deletions(-) > > diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c > index 4e6e70250048..104b87b98455 100644 > --- a/drivers/iio/accel/mma8452.c > +++ b/drivers/iio/accel/mma8452.c > @@ -1538,22 +1538,14 @@ static int mma8452_probe(struct i2c_client *client, > data->chip_info = match->data; > > data->vdd_reg = devm_regulator_get(&client->dev, "vdd"); > - if (IS_ERR(data->vdd_reg)) { > - if (PTR_ERR(data->vdd_reg) == -EPROBE_DEFER) > - return -EPROBE_DEFER; > - > - dev_err(&client->dev, "failed to get VDD regulator!\n"); > - return PTR_ERR(data->vdd_reg); > - } > + if (IS_ERR(data->vdd_reg)) > + return dev_err_probe(&client->dev, PTR_ERR(data->vdd_reg), > + "failed to get VDD regulator!\n"); > > data->vddio_reg = devm_regulator_get(&client->dev, "vddio"); > - if (IS_ERR(data->vddio_reg)) { > - if (PTR_ERR(data->vddio_reg) == -EPROBE_DEFER) > - return -EPROBE_DEFER; > - > - dev_err(&client->dev, "failed to get VDDIO regulator!\n"); > - return PTR_ERR(data->vddio_reg); > - } > + if (IS_ERR(data->vddio_reg)) > + return dev_err_probe(&client->dev, PTR_ERR(data->vddio_reg), > + "failed to get VDDIO regulator!\n"); > > ret = regulator_enable(data->vdd_reg); > if (ret) { > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko