Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp693870pxa; Thu, 27 Aug 2020 13:10:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweJPdXQOSYza6w6+PKPhjaykm0NE2i4BNvRA+v47vFInliKMxtiWMuGe0ZITxxNot532uA X-Received: by 2002:aa7:c405:: with SMTP id j5mr11429307edq.329.1598559017906; Thu, 27 Aug 2020 13:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598559017; cv=none; d=google.com; s=arc-20160816; b=y9aZ2+7HjBOo3x5XeMK6m+oLSlxrXaknSDPYvESiBAbs+XqYFiDM2bCku/6LPQ6pL/ Yh+AdpHgZmfb2ba6iT9kxZx8uKUVLAsXscfAABha8J4MXzXR8kn7sBW5PbbrvMmuWwJQ Y/BwfIdcDGR5M1sVqfp3X5xx3FPPu1j5r6COhmOHdYfaakUfLzdUmAZ6qb+nxsAWHRHb KRpBR8PQal7WNm0cmN2O4YLWFLbj79EFQMehKkXV9MmJkf/961OIcRuzwBsPtQeGXLuY aMfw62TDJ6f1Rv9guvbldmOF3FlQe3LkbQ2tIrd9ziUMMsDnr9eoL9+5okcPJYB8abWy 0IIA== 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=6YwhlwOg1Au0r42isHymTlEkI487Ef34iYmuMjODsEk=; b=Y59vGKREf8qLXT2VZw6mndffLXi91hw0i4fN/Y9K2xnXYOvNcd91pX1fP/u7TCN4Qy KyO5jm3rwdUNwmyfRj0khsfMIMfUKwQ99VCoCDnBWOXz6gUZrkeBKAsLURzA6Z06u2u3 p0GBman6kSyMvyiPv4cX517tJsxJ1ISpGp+NwZolhRL2i/YRgisYt3XIjpmIjUNoKqAe bQR2+GMfQall1TN2UZptVAtA2P08ee6sezAR7k68Vhj9vdidn7kw5VZABolLsTNmgIfl XsDw9mufqlCYi2TnPQtmwiPoKeiaT+Sb4qrSHZgEbVom34lQ2alwrrFCddh+Y1F/etra 3JYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sCPSmc9R; 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 r26si2171252ejb.209.2020.08.27.13.09.55; Thu, 27 Aug 2020 13:10:17 -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=sCPSmc9R; 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 S1727863AbgH0UIw (ORCPT + 99 others); Thu, 27 Aug 2020 16:08:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:55358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbgH0UIw (ORCPT ); Thu, 27 Aug 2020 16:08:52 -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 6543520737; Thu, 27 Aug 2020 20:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558931; bh=HjZ45Ea8Nex20zUFNvtFaU1eRcozwjjKB1eLAew+OQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sCPSmc9RxrMHbIf6S8DABmPBVlWx8Ssyvwkq6fqtZgQ4sPo1puCHk3yqn4Jhj0CfV 4ut/br5MNdIKoFME0nJm9+dMCdSXmVHF8pKuMZJ+qgVlKu3KSC6Iq8q2JBSEb4+Y8W IXv0MI8WvrzwzNgPoCG63B4mZtcC0EieIcoaOhTQ= From: Krzysztof Kozlowski To: Ray Jui , Linus Walleij , Bartosz Golaszewski , Florian Fainelli , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Keerthy , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Michal Simek , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH 5/6] gpio: pisosr: Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 22:08:26 +0200 Message-Id: <20200827200827.26462-5-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827200827.26462-1-krzk@kernel.org> References: <20200827200827.26462-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/gpio/gpio-pisosr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-pisosr.c b/drivers/gpio/gpio-pisosr.c index 6698feabaced..8e04054cf07e 100644 --- a/drivers/gpio/gpio-pisosr.c +++ b/drivers/gpio/gpio-pisosr.c @@ -148,12 +148,9 @@ static int pisosr_gpio_probe(struct spi_device *spi) return -ENOMEM; gpio->load_gpio = devm_gpiod_get_optional(dev, "load", GPIOD_OUT_LOW); - if (IS_ERR(gpio->load_gpio)) { - ret = PTR_ERR(gpio->load_gpio); - if (ret != -EPROBE_DEFER) - dev_err(dev, "Unable to allocate load GPIO\n"); - return ret; - } + if (IS_ERR(gpio->load_gpio)) + return dev_err_probe(dev, PTR_ERR(gpio->load_gpio), + "Unable to allocate load GPIO\n"); mutex_init(&gpio->lock); -- 2.17.1