Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp689327pxa; Thu, 27 Aug 2020 13:03:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRMmy8nCRi0FtchbZ4cxkpvr2bRhvJdojdXfxtKkVv/gngf4Hu+SqtGunaMKmjLeUVbFdE X-Received: by 2002:a50:8e58:: with SMTP id 24mr22084540edx.199.1598558582117; Thu, 27 Aug 2020 13:03:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598558582; cv=none; d=google.com; s=arc-20160816; b=HOJrXa6nXvtg26W7KvXC9eWfRrrYMeUeMXknP5ccV9tLW3q+hzSyv4a+pt/H2LhU+Z Mna6EH5VnToUGDoQF8Ew7080FC9oMnHIDGe9ag1P3a0B7mA/mIYtGXbfvALecJYMrCJI jYhV78RVl799IjvAfe7efTnlk8Ptx0zVjyFcidxB/zOFhp8IFFQJmMAM/eX5GWrMSRfa jGkLUk2fHjqyv2ZRjv2oyvNCZuWw2Y9AQimhmlgvR7G9dvBecKwoTyY89ATEcJ8nPGnr 9juTPf1Ro80ve1u7aey2FNrB/GGawUrlynE8W41wAYgcu0s8iczZ9jjR2elvnVyAb/TJ YbTQ== 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=pvjSdv4nUxPfwBP9PKjoRBAQ4y+6+2F4ni6LT9Fuaqw=; b=UwEIIvxe5peUGSOXHEXu5TTHdUkHbeRJMigL3tho7N1BBgxGIwmAKxWnSYyS/SPTUe 7ewjI1lLF9q8SiyYXYWMq+auUS5E5k9XyXhn3kOvH1Ipp9OAqysyLeQNSx2O3mM7F72b p6h3793j6FYmdhDGWEAWeni5HgQxsliHd56N+qeGfUCTrWQDNfa6PgfYJaocfm1wNPCd qWL1uuexHjYF4Qzx2qj3sxhZQvwRVJlN/nbxzLBOtyruQIijjpNAZ6bLYi2nmwcix6GD Ke1XuqUFVTw4UTrMP/uHVA0QjGboEE0mvqYzaLACoesBvstz8Z7WkKrthulANmQRyxip BlRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H8LyWEgN; 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 dg8si2242400edb.276.2020.08.27.13.02.38; Thu, 27 Aug 2020 13:03:02 -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=H8LyWEgN; 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 S1727909AbgH0UB3 (ORCPT + 99 others); Thu, 27 Aug 2020 16:01:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726120AbgH0UB1 (ORCPT ); Thu, 27 Aug 2020 16:01:27 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02886C061264; Thu, 27 Aug 2020 13:01:27 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 17so4329176pfw.9; Thu, 27 Aug 2020 13:01:26 -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=pvjSdv4nUxPfwBP9PKjoRBAQ4y+6+2F4ni6LT9Fuaqw=; b=H8LyWEgNqOpDRjSSDYB9n9KmWL3CtBr2jnO1bgCkicNJQLaAzjXu56afxptqb2MvJr QE+3oafRBg5l1ARaKoGkOAqtmaPZR2pYOm1smalhZaJv6ND6sCy2q1yMwD1CQb+ny5bT jo+/Uve7QIH8I3TGoiXlFrnRmFnDrMxL41sZa2WJlyMnxr/ewFu0azP2BolPZNw8FL9S mYFfPBlosvKpNaNeBlCPfPbQOFWX775syR8FZmU9289TyTEPXQOOZi+KDmdAGqZC7Ir0 Zuy0V/AZ0QwQ0N6MekI9WFEVkauZr4xejAvIIW+nQw6Phj7CBtrcnlI69zL1vrD0KYAs xc3w== 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=pvjSdv4nUxPfwBP9PKjoRBAQ4y+6+2F4ni6LT9Fuaqw=; b=YrzgJ/bAC033qpc662807NVU+JhTe78PjE9vQLqb957gOoGS5BfnLQGK3hpWkID8vk lC14HNrlk8TeZTvwge7eMYsZES6t/aAW7yPQTQuwSnxBH2nC8a/CIqvA44dSfcZjCTM6 2Yc2r5wmjGRz4hmStXy4HZObED7YPUi942K6oXLFH9JEz4qlAECY7zYSWi7oYbyzn8aq v0MCoF+6t8/SUFfCuNu1amGsD8obLTxgddetglZ38AQCjgwasP8D+z4s7AmHP89MMW3Y R0unK96mPRd3cunP1bicrGUZShVuYxzR3BcIhipDmo94FBqq0xNgg510aNqVIWGPy+1R 3CRA== X-Gm-Message-State: AOAM532VcHJUZTyUyndWj+dEvuUqH/poThRtcu3+jLbBPb5D1LqhYcFN pjvX7YTTgK9vg/FBi/eJoeIOFnsMj32e2QDugSw= X-Received: by 2002:a63:f24a:: with SMTP id d10mr15676744pgk.4.1598558486512; Thu, 27 Aug 2020 13:01:26 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-16-krzk@kernel.org> In-Reply-To: <20200827192642.1725-16-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 23:01:10 +0300 Message-ID: Subject: Re: [PATCH v2 16/18] iio: magnetometer: ak8974: 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/magnetometer/ak8974.c | 11 ++--------- > 1 file changed, 2 insertions(+), 9 deletions(-) > > diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c > index cbb44e401c0a..548c686e29d6 100644 > --- a/drivers/iio/magnetometer/ak8974.c > +++ b/drivers/iio/magnetometer/ak8974.c > @@ -843,15 +843,8 @@ static int ak8974_probe(struct i2c_client *i2c, > ret = devm_regulator_bulk_get(&i2c->dev, > ARRAY_SIZE(ak8974->regs), > ak8974->regs); > - if (ret < 0) { > - if (ret != -EPROBE_DEFER) > - dev_err(&i2c->dev, "cannot get regulators: %d\n", ret); > - else > - dev_dbg(&i2c->dev, > - "regulators unavailable, deferring probe\n"); > - > - return ret; > - } > + if (ret < 0) > + return dev_err_probe(&i2c->dev, ret, "cannot get regulators\n"); > > ret = regulator_bulk_enable(ARRAY_SIZE(ak8974->regs), ak8974->regs); > if (ret < 0) { > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko