Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp694194pxa; Thu, 27 Aug 2020 13:10:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGG8LgYLtGPLSsJaouPG+K1KXSFwHK/WT9s30lUUwErIEMFseGxe7FY4ZEOSxDBUxmESEv X-Received: by 2002:a17:906:4994:: with SMTP id p20mr21081177eju.299.1598559051417; Thu, 27 Aug 2020 13:10:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598559051; cv=none; d=google.com; s=arc-20160816; b=st0x/L17UIRt8zsmVyp3Ib/Nzyhc9MxJKt8CExvrrTuWSFCfR78IA3vhl8HJ6WgNzY E/JtZuOOdHwY1b18enLnjG9mtV/k6bimcAEs7z2k7R+njziN+5Hc1tz7G4bN5XhE2G1O OlNt5xaa0l7RXukt1klAA03bU+Y1S7y/xMozVfOX2DT3Dh8gCH6GrzvcYxSMhgOjaiZ5 C5uAMW2Tuq66P4+10+zFd8d0yxzRaboJWfL88gfyyLBWfVWXHxvKhE0+lsOGNQ5P4ppt /n5BZTnPqRkT1mrH37BvFATNkwDdk0IN83Zrn0i0Vcafzz8wDgPrxN7MUIIaNWkRsNMx roFA== 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=vZT5BH7UmsXtaavMY62pEmVxpuvXLqEULIjp1qf5wgs=; b=tNnjWEcGarWUAClgm/LaRuAonCiHma0M0GDWfT6TKkWxokhQLsmSI85JrUP4bQO5H/ oZpamBtuW6UC0148OkSuXAdo9ndSNCAB8fxFzvDBFUi7jB+iNH0TrYfcvE0McKT9Qyxo gwv8JCFJZZ1r8MKH9cyTfRSVvjsSVTkEmK3Yz2BtnCNewprlJtJIcBpjyL9+nm60avGw KX6Q8F5u52+EQxeVnugz1Zl4fsL4G7EkaG07TaT4nHR+k2lF8cQGBus7uYf9nQzpuXwj XYHh0A121GfAyTOc9zW42N8U3nzNRDd93hur8GxiN4k3wCy/fHRUoif2mDVKNMnMqyhQ Mb4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AXqlSAar; 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 b2si2210787edy.370.2020.08.27.13.10.28; Thu, 27 Aug 2020 13:10:51 -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=AXqlSAar; 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 S1727894AbgH0UI6 (ORCPT + 99 others); Thu, 27 Aug 2020 16:08:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:55438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727103AbgH0UI4 (ORCPT ); Thu, 27 Aug 2020 16:08:56 -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 2A4B6208FE; Thu, 27 Aug 2020 20:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558935; bh=jqbCUCwaNDypOtzCNXSWzew6krtWZkO/KHBOcaEh1TI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AXqlSAaruLYKES5GfoaCIjkIXBGmvuw8aRlvNYhegqHJbE3jQLVi2gliQbBq9Z3xE 6uyX65ypKowMOFwSzVDeI/hstiynecXeTy62V8G5bGMqAReK88sFO4orKu5nLw2MNK FzV7xOQPilZpKvfXFITbH6G2tnGGsah1K5NuoSBg= 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 6/6] gpio: zynq: Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 22:08:27 +0200 Message-Id: <20200827200827.26462-6-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-zynq.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 53d1387592fd..0b5a17ab996f 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -929,11 +929,9 @@ static int zynq_gpio_probe(struct platform_device *pdev) /* Retrieve GPIO clock */ gpio->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(gpio->clk)) { - if (PTR_ERR(gpio->clk) != -EPROBE_DEFER) - dev_err(&pdev->dev, "input clock not found.\n"); - return PTR_ERR(gpio->clk); - } + if (IS_ERR(gpio->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(gpio->clk), "input clock not found.\n"); + ret = clk_prepare_enable(gpio->clk); if (ret) { dev_err(&pdev->dev, "Unable to enable clock.\n"); -- 2.17.1