Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp686476pxa; Thu, 27 Aug 2020 12:58:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjAGAJHDN4bmwidfkPyW6nQAhaa9jxqUt6YPdIUHc0uUDdJRDyG2WELc7KUItf341a4Ra7 X-Received: by 2002:a17:907:72d2:: with SMTP id du18mr9272139ejc.359.1598558310199; Thu, 27 Aug 2020 12:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598558310; cv=none; d=google.com; s=arc-20160816; b=h4aGhC0urvreAUau0HaPPVpQbJZLFSLx6T8fZpJY6S2msxN0Vj9NJktCTiKl2/+NDI Wblb36c6PiKttBdIQu1K6IG5VVZ9LzRyk/tC7KKN4sQrw2Jn0C48ay0Ofx9CIPTrQWK5 e2gKK0TWKvmqbKZ2x8Y2v3tqsHnWogNNoPl2E+dEZeb2EMKSgSEGp7ugCjK7Nlu+Ltef AzFvN6DD7VjnpG16f8pQ9yIFBCbZ0JUOUNFyRnJpasOQln98jdMVDO6/7q7+siw8ARW5 A8fTA+4dEScHrOkkh2ZL490LcVdb3gN2BICGmqbPegX2jsJ9ovI7XI3J9tYScDdwEUbM ZV6g== 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=a447o0TIIe56Effe0RiDEzq1r8VXzso23Bql8Sh47SQ=; b=coRB19XX6PTsyiUAHFbz0QRxi25+EPo1cGfdxZxGKHJpaPaMal/45gKl3LDitLNa+G /J+40jK9lCDX3b2N0KyR03caCKpT5wGn9wyP/V5H32ojNusaj0osAh5arV3NHYj4oEu1 NuPdU+2uNupdetIrDncH+ZzlGq1EWcTG+xc8Zo6gBn3xxaIpgl1nF36qalvEHgDu3aCg 6O3vnWQ2bpL0QpZJQo4dgclDtIrq4uNEEwj2FFbedscWUxod6W8KXNX8iUXCV+TBNbsb OK10R1pNqNjSzE58P+hGpAiqGG3w/geBmw8uVcov7yhM8dRSHFIBf3hmfUu02x3WccjF xdhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iJNPerv+; 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 o9si1957499ejr.219.2020.08.27.12.58.06; Thu, 27 Aug 2020 12:58:30 -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=iJNPerv+; 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 S1727015AbgH0TzY (ORCPT + 99 others); Thu, 27 Aug 2020 15:55:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726120AbgH0TzX (ORCPT ); Thu, 27 Aug 2020 15:55:23 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81BF9C061264; Thu, 27 Aug 2020 12:55:23 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id v15so4115163pgh.6; Thu, 27 Aug 2020 12:55: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=a447o0TIIe56Effe0RiDEzq1r8VXzso23Bql8Sh47SQ=; b=iJNPerv+D6Wlv6jntU6RuRXEHqUp0FtUPafG+q6O82bxjmsX3wu7vAqvlxhZaghmSH dUNPoFLCxeQT9RuzUpIQ2d+NiOiS0UACXwcF5I17AfP+xEbYRmaqzxZEDbKx4KekJt0/ o/zQVjSyDNFrTQRZRXUONJ8yRxCiBNZgwZTwnCzUgJdnJtYXkG/g70yPUVIjLa0w+/JA Tx3TDT9Z0upM8vHEOacF2i6Ow8CajOZIWnlL8NU0rd+QN2ctK8aTkUHNxM4wv4oiSONl 3nS6f94NDBc2sfh5IC73mwfWYinCyfMaWBDtva/HV69+ec5NQT+QJzccwa6HzQx67i4R /f0w== 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=a447o0TIIe56Effe0RiDEzq1r8VXzso23Bql8Sh47SQ=; b=uRkz7oc2X3Cwo+zWG5SiiDoGwS3uy/GXG5fCKUIiEouJiAi5LvDjda+/NDpeQcr+Of qI148w1hEFRUmfDoNmnZgFnP3rmDJNtRdyhguL4tB9vrMu7ceMlCt7QB6LMNDgTu2XFM F2b7lePYQqEIKTm8H0V9odgCEJ2h9pTyc3qs6DHHa4QZGESgcrEcLUHtkVLo0HdIJOMl SuH/1Q9PksZxDOYaIR6iEqI/ruBECNxi301BaLEfX7eoTWXu0zXLbfGPF4ONESabJ7g0 3t+MDBh8oqqai7EQNOJmjt27o4KT7PkMItAU0PSPeFM/rrnSlXrOlM/K3dlwIp7VhcRP t0sQ== X-Gm-Message-State: AOAM532KxSbSBJuCoYskl0Gq80PSnncob8RPa8e9YCF3FcRIWMoNBAUa UH5s1Ru0HIi/b9Y2SB3Edu9Z/D7/fD4fEXueFeM= X-Received: by 2002:a63:c543:: with SMTP id g3mr8405213pgd.203.1598558122833; Thu, 27 Aug 2020 12:55:22 -0700 (PDT) MIME-Version: 1.0 References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-10-krzk@kernel.org> In-Reply-To: <20200827192642.1725-10-krzk@kernel.org> From: Andy Shevchenko Date: Thu, 27 Aug 2020 22:55:05 +0300 Message-ID: Subject: Re: [PATCH v2 10/18] iio: amplifiers: hmc425a: 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: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 > > --- > > Changes since v1: > 1. Wrap dev_err_probe() lines at 100 character > --- > drivers/iio/amplifiers/hmc425a.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/iio/amplifiers/hmc425a.c b/drivers/iio/amplifiers/hmc425a.c > index 582708924e4f..bde11df4bb9e 100644 > --- a/drivers/iio/amplifiers/hmc425a.c > +++ b/drivers/iio/amplifiers/hmc425a.c > @@ -201,12 +201,8 @@ static int hmc425a_probe(struct platform_device *pdev) > st->gain = st->chip_info->default_gain; > > st->gpios = devm_gpiod_get_array(&pdev->dev, "ctrl", GPIOD_OUT_LOW); > - if (IS_ERR(st->gpios)) { > - ret = PTR_ERR(st->gpios); > - if (ret != -EPROBE_DEFER) > - dev_err(&pdev->dev, "failed to get gpios\n"); > - return ret; > - } > + if (IS_ERR(st->gpios)) > + return dev_err_probe(&pdev->dev, PTR_ERR(st->gpios), "failed to get gpios\n"); > > if (st->gpios->ndescs != st->chip_info->num_gpios) { > dev_err(&pdev->dev, "%d GPIOs needed to operate\n", > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko