Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp180769pxa; Wed, 26 Aug 2020 07:54:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+EZFw8pzfVPGSJihjRcYzKSKsshe/90vaHFRp/vqhUtweMJ76x2iX6t3CmbkrRxMJcPpe X-Received: by 2002:a17:906:6558:: with SMTP id u24mr15304708ejn.364.1598453693582; Wed, 26 Aug 2020 07:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598453693; cv=none; d=google.com; s=arc-20160816; b=tYFqC4FKa1Js0kTrUReiFruOQX6ZsaLTAKXdNgX6wHv9Q3SMILy4T2lisvZwhNGkr3 olDh/4w1azGsjglpAdvOnfxvqSN5jttDz6dzLkQ8lNXMCqG28lwowS2jVaXZDeDj2MY+ vSh/3J5JvXiNsvqejdsTGHXP2Lfz2KjiYRQ9hUAiA9Dcsc+2xa3rSVZ8iORjZ2ly6vDL /YvtK/Wcr7NKb4adwNguhAG6NDHKeEIiGUUE0EAW7ASatKCEHVebbVfPUhBCZLjMJOUJ hooC4eFi8iWBIs3dnu9dACdka/NJ4HWj4Qjh+TYa/Mti2ibfDRIVn33dJOEv72YFcG4x z/QQ== 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=vK0YOk2cCsUkkx6H0vPXTYj352S8UNwrp4tz4Li6yW4=; b=Rm9X5Ewo+6k7ovI4YYA8ZNd3PEIyAqnymKY2RAI+jR08VhdOR6BIzFFt9abGqhKZPd +cbkQaNjY6NoGbhGFMP5naC70rXDqeHz68sLvv3+dEL7piIk/jS+63V5P2CBFkaVBoqa yfvDg+0WAuEmawJoTjGjQ1lkgmqroEkQcUScyYChY+Zx3+by8ATLlLRU+WL4+9bM47BY NZYlvOZqmhsjV+CdcyodsUS9GRBycSuUgqLbXxthkrlKEoxY9Vw87UenpCyHvey3MyGZ lVsnqD12D8NAxMRH08yHVDtjNQNSgevV3oe2qI2HIGZG16IfiN5xariv/kKmBDQQEv3Y CoxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NMEJK3RF; 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 w23si1701238eje.357.2020.08.26.07.54.31; Wed, 26 Aug 2020 07:54:53 -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=NMEJK3RF; 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 S1727116AbgHZOww (ORCPT + 99 others); Wed, 26 Aug 2020 10:52:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:38756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728080AbgHZOwZ (ORCPT ); Wed, 26 Aug 2020 10:52:25 -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 90C152224D; Wed, 26 Aug 2020 14:52:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453544; bh=BjFbji4PFSaomI4/2UsbpzM496UR1gTI3GZp0d8DKV8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NMEJK3RFge/3/cUnFjzfFf8aKnt72KOUHFY4NygxwM0h6c5Xzr+hqxGyVVkhidX5J GYrWHJDpZwj83LxeAOEEjz2k+aMkJGg3l9OfHstCnQIyrE4IFQHWw5080NSFjOnpWp Kr1niJu1vciNfw5xgBJBVvWdRANIBuZHBveEVIP0= 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 04/16] iio: adc: exynos_adc: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:41 +0200 Message-Id: <20200826145153.10444-4-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/adc/exynos_adc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c index 7d23b6c33284..20477b249f2a 100644 --- a/drivers/iio/adc/exynos_adc.c +++ b/drivers/iio/adc/exynos_adc.c @@ -844,13 +844,9 @@ static int exynos_adc_probe(struct platform_device *pdev) } info->vdd = devm_regulator_get(&pdev->dev, "vdd"); - if (IS_ERR(info->vdd)) { - if (PTR_ERR(info->vdd) != -EPROBE_DEFER) - dev_err(&pdev->dev, - "failed getting regulator, err = %ld\n", - PTR_ERR(info->vdd)); - return PTR_ERR(info->vdd); - } + if (IS_ERR(info->vdd)) + return dev_err_probe(&pdev->dev, PTR_ERR(info->vdd), + "failed getting regulator"); ret = regulator_enable(info->vdd); if (ret) -- 2.17.1