Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp688970pxa; Thu, 27 Aug 2020 13:02:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9gVKb20IaLoP5Ex+EXIglTZPMuc/P+wfChNUuP8Awq92sRq5xQmUNaYew9Rn1FfK8eCgQ X-Received: by 2002:aa7:cf8a:: with SMTP id z10mr20862965edx.323.1598558548097; Thu, 27 Aug 2020 13:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598558548; cv=none; d=google.com; s=arc-20160816; b=iaoz/hXvpoVwTPnQJInVC3FdC2tTGhucJco4TahSVa3XqYz6PXSDtFTOpM6bFXEKCy ctAelAaiMr1ao3gkvBNc59yxhGK8RjLtv7jitIuSU/WbCaly8fmKis93IP7muhI2jrvo m9t2/0d0Gze6yVxuG2QVM0KV2T/gjt4bGAvKgjvJOA7EKmdNuvekAHcwCmBxvAhX5cYd cLDtuoY2Ca0I47+2BxBYY/LglouEnbi07qgYGcEvIWNxK1jJfy++/LBRNj55zmlihaBO UPoGuGM1R8WngmB0bD723vjCOCyak8dykWzfMJaVci5ud91wIRCMC9TaJHjLMcgUf524 vtFA== 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=BtW/ozpx4qaFKtR4WdRiyJH+a5pa+/rdp0E0zYCBtiw=; b=qA90TTVsSJCrWUs2mpcAuY2AWn8wNJTZqW4D2+jK8aEgbOw1fn7lyiJMdJ4knjoZuw Xhg6MQRl4BVYwtJ1DqBeb4IDTzXx5U2LGogIMdTHUWaOkywWcyfTsdO3yePU3TKhgwSz o4Keqf4T9k6Ta1RzvUA0cWNLzOK9ed3Adw23MpyD46/mdyF8CfkjkzllJnbYd3EFdNNr wC43Q64UIReME0g3pdGN/8kwW1j9kK8gnXtFsr6rASoqm+oV4K4Rugr+/BnBZBIsI5CK 3vnvEfH4LaxI9Pmzji7ywdzc4+LY3aVkGUFocVeGUfXsk9QqPVEB1FN25RcTvJ0UJSXU hMlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AjsVfQcb; 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 l14si2291621edv.544.2020.08.27.13.02.04; Thu, 27 Aug 2020 13:02:28 -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=AjsVfQcb; 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 S1726839AbgH0T7v (ORCPT + 99 others); Thu, 27 Aug 2020 15:59:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726147AbgH0T7v (ORCPT ); Thu, 27 Aug 2020 15:59:51 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1224DC061264; Thu, 27 Aug 2020 12:59:51 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id i13so3210424pjv.0; Thu, 27 Aug 2020 12:59:51 -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=BtW/ozpx4qaFKtR4WdRiyJH+a5pa+/rdp0E0zYCBtiw=; b=AjsVfQcbbs8m2CmFrHV0gwxOPDDFel6Dtuz0EVsMe9pOvePSe2KyCjg5R54J213aA0 dYs7dOdAsqUXhUKoWNElRVtmUGHCALn0WOiQUKE3W6V6pIo5TVmtY5wvgoJScOJBWpF2 ZwroeOfqHbSXgH9NOC4gFVc4jTWoND5bcI6V09T8yOcf2ohLyiHpQVEaPEZNqdAIqkPI UeZlWWC0M/SJWy9F5wyNplXtqhJHSmtWHVsSFfV7wIy865aw2DytyMKKrm30aAaK0iG0 tmW4yhgyhYPR7janwCUFLJmWVHIfAqhea6q549D12zbhnsK/fJvsZeTjhzSky3l/gGR3 9QZQ== 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=BtW/ozpx4qaFKtR4WdRiyJH+a5pa+/rdp0E0zYCBtiw=; b=Kwd7yYFMwfiuNdfmp+yz5o1rncNWB9qPDyZtWExxlxb8jfMZz6V4ugrZG3gNDlc2Lu WOP+6v7QVSuSsS2jhlV5ts3tcjxnw9hPpiU8BDYAmdO5Fxbu/SEKxLAVHnoxF0IrjO/K fYqjVuI1F3I59QYY74je8A8sFKay/8fSYOgbYnWsiM8Y7qNzmXm+diQK4PlIjiMVvvkA z2H+Rl7pVmDotZo9pQVnvFehHvxceSbo2XCjvkxxrWCE19vb2Ev130tTFR1lvbvpXyUv OGx5aaQrrxZqel8ktyH2n2cmSUS30mOD9M0gX4Yd0fx5fDArqMupcXRW5ldyVkxDamRW U/JQ== X-Gm-Message-State: AOAM531i0WXafupecX5sW+1tC695hmyZXBdKSlnhHGvDscXKaPjmbUaB n+f660MrNuQojTSJd59GiLmX1iqtbg5j75Rw0hE= X-Received: by 2002:a17:90a:2c06:: with SMTP id m6mr433859pjd.129.1598558390619; Thu, 27 Aug 2020 12:59:50 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-13-krzk@kernel.org> In-Reply-To: <20200827192642.1725-13-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 22:59:34 +0300 Message-ID: Subject: Re: [PATCH v2 13/18] iio: imu: inv_mpu6050: 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/imu/inv_mpu6050/inv_mpu_core.c | 20 ++++++-------------- > 1 file changed, 6 insertions(+), 14 deletions(-) > > diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c > index 3fee3947f772..18a1898e3e34 100644 > --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c > +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c > @@ -1475,22 +1475,14 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, > } > > st->vdd_supply = devm_regulator_get(dev, "vdd"); > - if (IS_ERR(st->vdd_supply)) { > - if (PTR_ERR(st->vdd_supply) != -EPROBE_DEFER) > - dev_err(dev, "Failed to get vdd regulator %d\n", > - (int)PTR_ERR(st->vdd_supply)); > - > - return PTR_ERR(st->vdd_supply); > - } > + if (IS_ERR(st->vdd_supply)) > + return dev_err_probe(dev, PTR_ERR(st->vdd_supply), > + "Failed to get vdd regulator\n"); > > st->vddio_supply = devm_regulator_get(dev, "vddio"); > - if (IS_ERR(st->vddio_supply)) { > - if (PTR_ERR(st->vddio_supply) != -EPROBE_DEFER) > - dev_err(dev, "Failed to get vddio regulator %d\n", > - (int)PTR_ERR(st->vddio_supply)); > - > - return PTR_ERR(st->vddio_supply); > - } > + if (IS_ERR(st->vddio_supply)) > + return dev_err_probe(dev, PTR_ERR(st->vddio_supply), > + "Failed to get vddio regulator\n"); > > result = regulator_enable(st->vdd_supply); > if (result) { > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko