Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1708509pxa; Fri, 28 Aug 2020 23:51:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgtYcVsjTbSdefhTaziJw0BrdaoLYvb/wN1F2q0H6riUqPaPkZQ7Ex307ipzTZMgViZNSQ X-Received: by 2002:a50:9f6f:: with SMTP id b102mr2269500edf.272.1598683871119; Fri, 28 Aug 2020 23:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598683871; cv=none; d=google.com; s=arc-20160816; b=Rp0BB2ro5/K5r8t1caEJ0EhpzYF3Disl28IO/Dp4zx54FJyN+eqkC+F/b9wL3hOMxs XSHyjv24fXZg5urf8JS9nty/4fU1b2oQ40lWXfPyiF2KB07DXO8O4uB2dHxPlDqZ0XXm pNl+VJIMoKgzgvjfMb8pFlgp7+wfz23fkzva3WQOWu3I71qC/5db2avuPgRipBadGXg/ 0Qo83l4pQHri0uVg2uEF0GETVfknFctnxf02Mcv8CVhnV2eXOgLdGGlLXqjyZjXqqgnD tu0TuTbeyI4euaZrTKvHBwjoLEmOG1lTM5028It+uVILSke4m7JUlls9sQQQN7C2KX1e EyTA== 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:cc:to:from:dkim-signature; bh=UGYGN6v2CUYL9alSeqfUBgHaTdjE3+2rs/1f2vDWJ4Y=; b=StRb7BhRMns16JGshKiFjrUbvbg3kSil41lfNc3glb6EDsURY5ofzs82ENlStAaY30 p0AuOxbs+HtXvqyV9H8FjSoZZezZiG6Sx4QkCdt+4UmEooUZl+pC6gJjd+txz5ab19Rs kda4lMyG0TfnZefMDuwBmL5Ozx2vNMyMiII2jL6zFeUSR5wQmQzwFr5jjMgJpfyS4ffm BaIKgB/On+TC/M3OQ6RtuP/L4M8nowkKB3KbMkjDJQZp3daV6mM/UERgjNh1UFPHMjJ2 uohi9ZAWex6K2HOGKAzWZZB/98E1dQdL1qIKy74KzkkM3RP7ndnvzGgor5O6nGXnDvip uEcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=thEheuIY; 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 g13si1325878ejx.63.2020.08.28.23.50.48; Fri, 28 Aug 2020 23:51:11 -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=thEheuIY; 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 S1727937AbgH2GtU (ORCPT + 99 others); Sat, 29 Aug 2020 02:49:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:41516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727051AbgH2Gsh (ORCPT ); Sat, 29 Aug 2020 02:48:37 -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 EC1602145D; Sat, 29 Aug 2020 06:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598683717; bh=f6+Tik++luo2PZ4Mb2eOWG5RToVxg+N7sCh7U3p3bZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=thEheuIYmGXal/L7ScJpySupzF+kcZenN/wAYN1aU8WkvzbtgSihXdvgL+rLOi1i1 UY59B5HgzprHiRaWT/pGM10SlFXQx8P6ay+BHX86+1rCtDJ/EML25//SBRyEpzjFMt qJZqhXWIq6e0ppCE+CaKTEG+FYiz9Q8cNiJa1Xt0= From: Krzysztof Kozlowski To: Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Michael Hennerich , Marek Vasut , Tomasz Duszynski , linux-iio@vger.kernel.org, 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 Cc: Andy Shevchenko , Krzysztof Kozlowski Subject: [PATCH v3 10/18] iio: amplifiers: hmc425a: Simplify with dev_err_probe() Date: Sat, 29 Aug 2020 08:47:18 +0200 Message-Id: <20200829064726.26268-10-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200829064726.26268-1-krzk@kernel.org> References: <20200829064726.26268-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 Reviewed-by: Andy Shevchenko --- Changes since v2: 1. Wrap dev_err_probe() lines at 80 character Changes since v1: 1. Wrap dev_err_probe() lines at 100 character --- 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