Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3388915yba; Mon, 29 Apr 2019 01:08:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqynQgef7SiCIs2UpdicRhSOKbFhD4qvMzFx1rfkUGG7A0cxxA0ya77pWB2u5xixE3zyD6uR X-Received: by 2002:aa7:884b:: with SMTP id k11mr41893452pfo.49.1556525300092; Mon, 29 Apr 2019 01:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556525300; cv=none; d=google.com; s=arc-20160816; b=IECJAEuqtba0IKYssgQYL/+3UNC6X0fgHOskr11Uriqn3no/Wfb8A/Mlm+hIrjbx0D h9rbHN5LI2cCW+cCaHFD11yVS6iuwj1jo0hykswQDtQMYhioHxQT8H99npdhwcAxXofJ uvh7PVWcD1etb/x/BLws/7tw2Osqa55A1nLpIkQEsGUtSaCtHRvE1PKKfvEtwcN+kKhK y4btyyVEgG/3CMzUuDBfkIX9MgpvdKe1DEOESej5jt+u+Io5/yCP5UJxcgqM9Lhg+qcO sMpRQH/UmVazccQaUeyUASUdkPSFz1Q6qsU/+DInsxvDz9kAibnw7qHNwH1JVsFY2PWq dDnA== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YyXy/Ie73uurSifnxXwPPCjDOWFEG0F3DJdimxJFcAc=; b=zTJ58xLRRcIW0B3IjdWXAuI1OdAo9HJvkXiaQxYeRliY8oKTxxow+ervBesuIpI/kf o7eiZghgTapibbUAHstCaFCcxfQG6PXhdcu1ywcv3vgufHl+OrfkbmQPJjomtGDMNL0j JTGogMmOce/rkybIW7klIL6qom3FysDVdWgM0CB47xbKqLLNKKD4Q5tBVZlfiPn/7DXT wGSmbOuTi1mxMAkEpk0u0RR+83kvf3tQsTBAa9IRmN1JJ9aNdSdwyI/7FNltVN26TeJL SDEGOHrlMGEy9d2wUTDblRJ6jsaBlGJrLzgiZHV8wd28mVZ6gcZ/AdAWroHlwZBN/CFm 9r4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=fn6je0oV; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t21si32269680plr.366.2019.04.29.01.08.04; Mon, 29 Apr 2019 01:08:20 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=fn6je0oV; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727615AbfD2IFZ (ORCPT + 99 others); Mon, 29 Apr 2019 04:05:25 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:35708 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727362AbfD2IFY (ORCPT ); Mon, 29 Apr 2019 04:05:24 -0400 Received: by mail-ot1-f65.google.com with SMTP id g24so3226995otq.2 for ; Mon, 29 Apr 2019 01:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YyXy/Ie73uurSifnxXwPPCjDOWFEG0F3DJdimxJFcAc=; b=fn6je0oV2jgwh2sHe5zKMIc4U2H+O56n6fjSEqsXZCL+M7jv/d/4Yfuecsmkg1xJ9Q O279VIqyP3zsz0kl19ZfqlBEwrlTlLyy5yDRK5L4XZWEe5HxB5uIN9d9ISS6weZTErxW HildR8uWJjLWzSiN/X4kk3tNZZL9zrfLGrund0vKJwhNTFlQLdfTDvOHM8G5P9lX+3ic gYJIx+xi8Ve9UkNDMOJ0EFldRr4bCZ6j6Qw7hxusgce+jynuMORB7/7Sou09k6lsvTdm N/JbrKvegeGQmq8Lxu48MqB5G2qouNoSEq7+L1UwgUo1ui9vW7urRqoWT3ejm7hIebFk Hvyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YyXy/Ie73uurSifnxXwPPCjDOWFEG0F3DJdimxJFcAc=; b=UMYmKZP2va7Iy4Q64dB6jGAbuWZ606CNAqMj2/NRA9LkvC6MXLh+NVJAIO9A4BJCGJ vVXiQmaHG8WqVPqRM/s/03U6gMvysqzGjXu9KZyYuBIU+SmaCyBekryrSt94PHvSLTnM MrczwFOSu6v43ldfgFpwXjQ5ZiAq8rBCpD8k7IPGSCf+vlPO6AJFxtY29g5z1+jsJV8j yY5Z+Q4vBkBY5veBELHhvmOBCq1sxsNHkxNMtRI4fyFqrv2I67p2ArooYzecFvIpq379 jT8oNj/c2OhPphWm5vUwHV3FQvOQrXeNkJTfjhUAcTt3sVVx832wDOn7MTHDj8PzYdQ0 ZHzw== X-Gm-Message-State: APjAAAXH+pTcxqVM5NI4vpaaOoa1vtymwAtA0RhVlVPtEwjXeQemZdNa 8S2VieOZimRwX4RM+saV5P5ZVCqJNheW3/RKPxx2sA== X-Received: by 2002:a05:6830:150:: with SMTP id j16mr34168719otp.27.1556525123456; Mon, 29 Apr 2019 01:05:23 -0700 (PDT) MIME-Version: 1.0 References: <20190429054948.9185-1-andrew.smirnov@gmail.com> <20190429054948.9185-2-andrew.smirnov@gmail.com> In-Reply-To: <20190429054948.9185-2-andrew.smirnov@gmail.com> From: Bartosz Golaszewski Date: Mon, 29 Apr 2019 10:05:12 +0200 Message-ID: Subject: Re: [PATCH 2/2] gpio: vf610: Use PTR_ERR_OR_ZERO() in vf610_gpio_probe() To: Andrey Smirnov Cc: linux-gpio , Linus Walleij , Chris Healy , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pon., 29 kwi 2019 o 07:50 Andrey Smirnov napisa= =C5=82(a): > > 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 *p= dev) > return port->irq; > > port->clk_port =3D devm_clk_get(dev, "port"); > - if (!IS_ERR(port->clk_port)) { > + ret =3D PTR_ERR_OR_ZERO(port->clk_port); > + if (!ret) { > ret =3D 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 =3D=3D ERR_PTR(-EPROBE_DEFER)) { > + } else if (ret =3D=3D -EPROBE_DEFER) { > /* > * Percolate deferrals, for anything else, > * just live without the clocking. > */ > - return PTR_ERR(port->clk_port); > + return ret; > } > > port->clk_gpio =3D devm_clk_get(dev, "gpio"); > - if (!IS_ERR(port->clk_gpio)) { > + ret =3D PTR_ERR_OR_ZERO(port->clk_gpio); > + if (!ret) { > ret =3D clk_prepare_enable(port->clk_gpio); > if (ret) > return ret; > @@ -290,8 +292,8 @@ static int vf610_gpio_probe(struct platform_device *p= dev) > port->clk_gpio); > if (ret) > return ret; > - } else if (port->clk_gpio =3D=3D ERR_PTR(-EPROBE_DEFER)) { > - return PTR_ERR(port->clk_gpio); > + } else if (ret =3D=3D -EPROBE_DEFER) { > + return ret; > } > > gc =3D &port->gc; > -- > 2.20.1 > Reviewed-by: Bartosz Golaszewski