Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3295686yba; Sun, 28 Apr 2019 22:51:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxex/MQgyCzcr9o5tM6Rq5P+3qG2rqSohlYwfRVzwdoqnV0Hm3kb+KDTrxAs0BKp2XrEldM X-Received: by 2002:a17:902:382:: with SMTP id d2mr61125068pld.253.1556517102718; Sun, 28 Apr 2019 22:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556517102; cv=none; d=google.com; s=arc-20160816; b=sL2jEkhvRAV6su4230hjjN52lPOzC8vD2R2GJobiHt36RoKxLRkqilcUbUB/mKMSDE knSPkSaWWBbiRJv1QEgLHvKwN/V/BFL8QPTEVKoWjQwu3MZh8P+RPNGNTcSKxbR78hPY ifFxhuQ2CvXLoKZHSuUP2xh4UJD+z8hn86IFGJLksTG7rCSSOBMmnJ6n14Acak5UTyow E9CCX4Sk/tgdbi8mJ8HdXzI8tAEWVddyj2gZgvXKQry3OhAejSXynGprsiBADRa5OcLN dELTva/wsgSkgNyP//+7kPTKb8U5Zowfeu3vAFtFVAkVOAdF2R1Vg4S8BxG6bYIPv6p9 +YJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1GWGAD4Dj4+5oSlq68Je+LYnQAj+tRpSapBi4qIorTI=; b=WNLvOxvjNKHS9UKp4m6JCoqXjagPL34NnpxuYUlGRkXEyZYRZLfWkwPhKdWs77Aj3K PgSgYIj9WN74sOVAaHasBMT+CwOZiUbCsMAgyHCcPTUt0YxDQqLZM+ch7xPTFxO2N5vY aP6/l85vAGw8ypSJjMbXoYu+CgQ0BrcsPsOVaR5t3Jg+jN1UzN8i4/nTUS3nt3Fz+p2X sjuNnHJ6lTWSNky3Vi3xKuheNR2qEgoNHqTxtwHOWhM4rb2fIJxfSy1sP4qFcZys1i31 wQBAfa8ERSHcJSQ9ykRRkVriRxTdsDUMXvfpKcQouzKylLQaOQxvo0kZjtK3Lqn10K5P iBRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lOI+j4UQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r6si387475pgp.466.2019.04.28.22.51.27; Sun, 28 Apr 2019 22:51:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lOI+j4UQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727397AbfD2FuS (ORCPT + 99 others); Mon, 29 Apr 2019 01:50:18 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:40070 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbfD2FuQ (ORCPT ); Mon, 29 Apr 2019 01:50:16 -0400 Received: by mail-pl1-f194.google.com with SMTP id b3so4537174plr.7; Sun, 28 Apr 2019 22:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1GWGAD4Dj4+5oSlq68Je+LYnQAj+tRpSapBi4qIorTI=; b=lOI+j4UQTx23vyL8CoAcmHGxvJK7KkTe+5oqv8YPWs9BynQy4oU7gZyZEDB8NrjxbV rx8J2UVZcmnPN8iXV09neuk2nGXvRhPx6awpGgkb7FZgEdmiywfzH+PePflGiIbFUSt2 ArP2uWeDTi5p3+ocVQnlHmF0Su7gkyztyML+FELzsYBybceDLcefAE8OnKwtohNaAf8j XMbrBm62BzSxZxwloctd4l23PCQjPAu08oqblD/a93yzmWKF7G8UIhN1wXTTuUhfFrs6 u2we6+FuL5H7Qu3FXKyxJVCs90cIVzx865HhBDKb7AOKxkKqGRoiSzdGg4OYLRP1fZMw 9kbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1GWGAD4Dj4+5oSlq68Je+LYnQAj+tRpSapBi4qIorTI=; b=Q4VIeDtfSw/eiQPwT+Nxzgjdpiw/aMC4SlCE49j5tHMN7t5ZP3+fPWaLmw2Z9V1VNu Um9qKSOUmsCMC42SRVlV4zIakQM7Disd/OD+NYX0kC6OpLLFkSh09L1CiqwkLeDUMSRS 36gKmWO59HpjUsGkOH7Vo9AfOSeIRvh+RMP5mXPVUSPS45sHG8xNeDQsCLCGsxEAZisA XX+NgNCuzzkItWacqdwDoTEmbYHePFC2Use7ORB2WKz1/BGhZR8CSiQpmOh/GF9SiIPp exb0STcjNBO61mMXX4zzFNGWG0MldpYk2Q85h0r+TUyw/o60umJNFk2fTcbXdbtgW+vz qOPQ== X-Gm-Message-State: APjAAAX7jL3iYxGhw4tjfnikhoYe1yiaqL5I3p8wcMiTyc99PWHsefTy 6yMU7wy+adc6LIHTOWMeQuhcTqw+Jnc= X-Received: by 2002:a17:902:bb0d:: with SMTP id l13mr10141934pls.141.1556517015023; Sun, 28 Apr 2019 22:50:15 -0700 (PDT) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id n188sm19613605pfn.64.2019.04.28.22.50.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2019 22:50:14 -0700 (PDT) From: Andrey Smirnov To: linux-gpio@vger.kernel.org Cc: Andrey Smirnov , Linus Walleij , Bartosz Golaszewski , Chris Healy , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] gpio: vf610: Use PTR_ERR_OR_ZERO() in vf610_gpio_probe() Date: Sun, 28 Apr 2019 22:49:48 -0700 Message-Id: <20190429054948.9185-2-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190429054948.9185-1-andrew.smirnov@gmail.com> References: <20190429054948.9185-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Simplify error checking code by replacing multiple ERR macros with a call to PTR_ERR_OR_ZERO. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Chris Healy Cc: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/gpio/gpio-vf610.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index 30aef41e3b7e..7ba668db171b 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -265,7 +265,8 @@ static int vf610_gpio_probe(struct platform_device *pdev) return port->irq; port->clk_port = devm_clk_get(dev, "port"); - if (!IS_ERR(port->clk_port)) { + ret = PTR_ERR_OR_ZERO(port->clk_port); + if (!ret) { ret = clk_prepare_enable(port->clk_port); if (ret) return ret; @@ -273,16 +274,17 @@ static int vf610_gpio_probe(struct platform_device *pdev) port->clk_port); if (ret) return ret; - } else if (port->clk_port == ERR_PTR(-EPROBE_DEFER)) { + } else if (ret == -EPROBE_DEFER) { /* * Percolate deferrals, for anything else, * just live without the clocking. */ - return PTR_ERR(port->clk_port); + return ret; } port->clk_gpio = devm_clk_get(dev, "gpio"); - if (!IS_ERR(port->clk_gpio)) { + ret = PTR_ERR_OR_ZERO(port->clk_gpio); + if (!ret) { ret = clk_prepare_enable(port->clk_gpio); if (ret) return ret; @@ -290,8 +292,8 @@ static int vf610_gpio_probe(struct platform_device *pdev) port->clk_gpio); if (ret) return ret; - } else if (port->clk_gpio == ERR_PTR(-EPROBE_DEFER)) { - return PTR_ERR(port->clk_gpio); + } else if (ret == -EPROBE_DEFER) { + return ret; } gc = &port->gc; -- 2.20.1