Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp185886pxa; Wed, 26 Aug 2020 08:02:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFf6KSPL1purBEqtzcgQ/ZXcfgT4GLcbrlqxVMAmSmiCu/x2MK93VOPTQTrenbVsq8Z64K X-Received: by 2002:a17:906:19d5:: with SMTP id h21mr15828403ejd.505.1598454133593; Wed, 26 Aug 2020 08:02:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598454133; cv=none; d=google.com; s=arc-20160816; b=rk2lsPqVFx1pE6vzAsJgOgt8dzBcL7io+FYvlgY1+B355TAaD0Le8Nqli7Hq3TyHbn A/d7G7Vx9SXL0LetiEgUWN4k9twdctKk7Kp1Wnj8RqntzBWThp6Bna7SfzU75yiUlD9z bqI/CTpzD5flHUkhLpkpeUSxbJVNtv9jEyLYBRd9RrbgKQM41OfzVQaHjNQgYTcATaPP YIMnG68XgeOgaT5QWgNR6gX4X1EaNiclgql4XkzkDLR8wJYFohlBYJ2A+e0DEN6kTWN3 kXC8xxe99a/xnrgKJuYyse2a9B0E3vu1NNmOY43uCFBPvuFmzry8Xh3CmRmHuQUwo2H7 n2GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature; bh=QdRyG5JTtBvpScCYrYODmgm21dO6YJavzYXpzZ7gbKs=; b=d8IHj9wczrc4gmNeTv45nj0+fUKZpPVeqojgZvED8DxLFnfwlAms1blhIPzITotiLb BKOSDFB8fNK7cOvtkIoM0on+aZS5jbtZ5SVLa1624R8dNiAXCfrjHJQOE54dr3sGvi6O yZTHjBfvSprHyQJ4jI6wgS3QK9axnbxjPXKNdYRwjhupmj9YN+772o4mMuGZgRuWFV4E kSqXVD3tGbdm2Ve1gRDcRVyayBIioAx1984i58DIANBXkvvgus+Ps00pIaGuG1wl/CUn SN4hYUAE+uedxRnc+fIrOe1jPdam1AxDWEyydmVcki9Y7icQlvhbUp70btSDB4GR4uqf qLGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lp7M6zPO; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e19si1757569eje.233.2020.08.26.08.01.50; Wed, 26 Aug 2020 08:02:13 -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=@kernel.org header.s=default header.b=lp7M6zPO; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728069AbgHZO55 (ORCPT + 99 others); Wed, 26 Aug 2020 10:57:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:39720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728169AbgHZOw6 (ORCPT ); Wed, 26 Aug 2020 10:52:58 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D9E0F21741; Wed, 26 Aug 2020 14:52:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453578; bh=EO6+OrtQUwKwY8gZU4JakHT0nILSB70xFqDRJMkESZY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lp7M6zPOo/NbXV/KmnrIZP2j/7osA6KnrnBkn7shBUFVg2hnnQTzWduD5TiLx0Ht8 fq7PppS6Qip528k2PlASRjtE6lMvHH0fsQdhFZGue0pxH7GKSotNtOcdL8qHiWjMfG CeSJAVZKWw9V3sMB8ZmCdfUUIu/6WJ+KVF8kZqgg= From: Krzysztof Kozlowski To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Krzysztof Kozlowski , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Jonathan Bakker , Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 10/16] iio: amplifiers: hmc425a: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:47 +0200 Message-Id: <20200826145153.10444-10-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826145153.10444-1-krzk@kernel.org> References: <20200826145153.10444-1-krzk@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/iio/amplifiers/hmc425a.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/iio/amplifiers/hmc425a.c b/drivers/iio/amplifiers/hmc425a.c index 582708924e4f..9efa692151f0 100644 --- a/drivers/iio/amplifiers/hmc425a.c +++ b/drivers/iio/amplifiers/hmc425a.c @@ -201,12 +201,9 @@ 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