Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp690867pxa; Thu, 27 Aug 2020 13:05:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfrl17RUgncMFfj4RKo4yU01CIZJbU2AUGY2Icek4PATws6xpJUiMpHqTanqGnqYIOE6dB X-Received: by 2002:a17:906:c7cd:: with SMTP id dc13mr22273262ejb.446.1598558727144; Thu, 27 Aug 2020 13:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598558727; cv=none; d=google.com; s=arc-20160816; b=nPhYnjxdwW9T2wpa4GW6tXMx5lUeyWIZjzyvjgHtcZVFgJsjnB25R8MVkIbAd486Yu KRuSVUZ0xBp3MIo5+R+2I/W8so1HNlUHEZVngoFpzjWhpX0HjWuuXiKpkJY8juB9a6Dr YPk77ue7PeQWStQj48N62disXy/OFL5ZjLaopcv7adyYNkRwKlFdhX2+ePbuCESJz9hp aTqX6jKNZmjQrAb3DGghkeBrE60caaOW+Qcmef68sqauYbDGuitNi/r+SQLfC+rxPpgL MNZmafhtJKMTgPUV41gU7rvj06vA6AoZGHCs4CMw1A5Lt16K8R7vjg538oNSTVtUpoyd Mw+w== 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=l6QdgtQwuCtCJCOXFFSMuQPOtSKidk6SZriT8+KhQKU=; b=hdNcSf0CWQ3KG6e7hyIM6XFUY7/8NW/lNviX/LPLpE1Th+5X0373An0D4DK9S9XI42 PfHslRJOUbK4vS1M4658EUKzhIgMCGe3ixEYYQqjVh2x3xNZtQun3pGH5zV0Ycb2QmFt FnLp/ZD9LIwsPtdFZLT2UyvEglLy64vKQEI+9C5tS8KUC0d36m7RXQF68EZm29kWg1Jc igqMyWFrba2oiDlPPdtR5OWaqJgRcAurVzCwX2D03g4EpAQt2GKlWIMw4B1SHtGQ2hoV vSE+Vs+VjDNqoohBH7mynjFh4u1OeAvK5CJuB1l9wW1sRLVwxrfBX3AfHUiNVs3zK+vv DPAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B784Lqlh; 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 y23si1966942ejm.712.2020.08.27.13.05.03; Thu, 27 Aug 2020 13:05:27 -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=B784Lqlh; 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 S1727949AbgH0UB7 (ORCPT + 99 others); Thu, 27 Aug 2020 16:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726120AbgH0UB6 (ORCPT ); Thu, 27 Aug 2020 16:01:58 -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 73BEBC061264; Thu, 27 Aug 2020 13:01:58 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id p37so4136449pgl.3; Thu, 27 Aug 2020 13:01:58 -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=l6QdgtQwuCtCJCOXFFSMuQPOtSKidk6SZriT8+KhQKU=; b=B784LqlhlWCORMwjfseGM9afIz00NTvMypFlKUBZTooVep4/T0/aixsxongGyx3wDz Vg2+U4LCeAI7Yib+KiJZ24l/0/FfhRaidOdFvUUWRes3nDyPcm5VV2ogvlsIYbadSuA+ 7hVKFLzj3mIih5YVGxJste5+4zT0jWH6QCHJ7a599HH1cEynJHhvbDzUrJNcVg+2LdYU vJz7JB1MzlPVeFxH+Ywz5BuZVnrsLEQqYGbsgA9TxfLbz9vHqcNbp9L8M3BveliFy6F6 slZQAUspB+XSx2BvCSYHwxT68ofD/WjT3JZJ47bsp376mZrFgkcUnV3hrR2G7TeJh8k8 Kv3A== 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=l6QdgtQwuCtCJCOXFFSMuQPOtSKidk6SZriT8+KhQKU=; b=l8szXOi/DYJwIhABmRWGWl79sDUNNKQK9scLYO9LNm1C/osSC3Jb2Ip1lCtUIMeCDu 4FEB1QNTQLRg+cC/+6+cN10Oi9IW6rzSoDjV85sZuapfJgfTBC5TzC5U9uaM6CJCJH2t OyyRx/+giCENSzJ8UALgT8OPplNgy3JiheuRjUyoLJjby6idem6aiKZDyMMn3AIluRwi Hm3BZR+Gf9LF2+XQOPouJE4xlPyy3CJ/L/7LzQJzbihgCfi25sB5AGAxeKzk7GnSfdWH UU9m98hS7AA5iXnVxhseWbXJhLUWTwVPiEOGa7aBtVyIl7fdCoenC4QtKJ5n7qE9Bnp9 WtAw== X-Gm-Message-State: AOAM533idCed/yGLPsxowVGgzoEgaePqGwbZjuQsc6/LgyT2HJY0yFdi C7hVGa6qnIrRL0l15cbFXGuQim+r+QheCSFxP5U= X-Received: by 2002:a17:902:8208:: with SMTP id x8mr6322386pln.65.1598558517933; Thu, 27 Aug 2020 13:01:57 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-17-krzk@kernel.org> In-Reply-To: <20200827192642.1725-17-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 23:01:41 +0300 Message-ID: Subject: Re: [PATCH v2 17/18] iio: magnetometer: mag3110: 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 > --- > drivers/iio/magnetometer/mag3110.c | 20 ++++++-------------- > 1 file changed, 6 insertions(+), 14 deletions(-) > > diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c > index 4d305a21c379..838b13c8bb3d 100644 > --- a/drivers/iio/magnetometer/mag3110.c > +++ b/drivers/iio/magnetometer/mag3110.c > @@ -476,22 +476,14 @@ static int mag3110_probe(struct i2c_client *client, > data = iio_priv(indio_dev); > > 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