From patchwork Mon Oct 26 18:00:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 11858101 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3AD901130 for ; Mon, 26 Oct 2020 18:02:39 +0000 (UTC) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9550D22202 for ; Mon, 26 Oct 2020 18:02:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.elisa.tech header.i=@lists.elisa.tech header.b="POCy/jxK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9550D22202 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+72012+121+4688437+8417402@lists.elisa.tech X-Received: by 127.0.0.2 with SMTP id uy9BYY4689772xVnicCcg9Lq; Mon, 26 Oct 2020 11:02:37 -0700 X-Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web11.1211.1603735357184355691 for ; Mon, 26 Oct 2020 11:02:37 -0700 X-Received: by mail-wr1-f68.google.com with SMTP id x7so13760939wrl.3 for ; Mon, 26 Oct 2020 11:02:36 -0700 (PDT) X-Gm-Message-State: vqoE72PpXXIXVvyfKpOgkU5Dx4688437AA= X-Google-Smtp-Source: ABdhPJy3v17H0nndO/wow3Iyw/sF1O6Mqems54hgdg6CPu8vTLvCzEuv3AXub44dapk3cnvbMC+Kiw== X-Received: by 2002:adf:e849:: with SMTP id d9mr20693375wrn.25.1603735355389; Mon, 26 Oct 2020 11:02:35 -0700 (PDT) X-Received: from localhost.localdomain (host-92-5-241-147.as43234.net. [92.5.241.147]) by smtp.gmail.com with ESMTPSA id r1sm25575100wro.18.2020.10.26.11.02.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Oct 2020 11:02:34 -0700 (PDT) From: "Sudip Mukherjee" To: John Stultz , Arnd Bergmann , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-safety@lists.elisa.tech, Sudip Mukherjee Subject: [linux-safety] [PATCH] misc: hisi_hikey_usb: use PTR_ERR_OR_ZERO Date: Mon, 26 Oct 2020 18:00:26 +0000 Message-Id: <20201026180026.3350-1-sudipm.mukherjee@gmail.com> Precedence: Bulk List-Unsubscribe: Sender: linux-safety@lists.elisa.tech List-Id: Mailing-List: list linux-safety@lists.elisa.tech; contact linux-safety+owner@lists.elisa.tech Delivered-To: mailing list linux-safety@lists.elisa.tech List-Post: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.elisa.tech; q=dns/txt; s=20140610; t=1603735357; bh=VXUzLB+zSSSOAQPpQttbIuyQ1vEWJlsRNXBprDexA6Y=; h=Cc:Date:From:Subject:To; b=POCy/jxKqJYYrBY2sKR3nGekBLfCHnO7Rj8S1emsJAGchXCv/3mMGrwgHkK1Hc6a9P6 A/9ujBKSqDVaemc8WS2NHTuZy5RzvDd9emNqnVZQYCJdYlq9yxNwv/f85/nFkgpw3NpTr 34qA6qJjeRXzAxqn/DWpYPM0U+x4aAQHaM0= Coccinelle suggested using PTR_ERR_OR_ZERO() and looking at the code, we can use PTR_ERR_OR_ZERO() instead of checking IS_ERR() and then doing 'return 0'. Signed-off-by: Sudip Mukherjee Tested-by: Lukas Bulwahn Acked-by: John Stultz --- drivers/misc/hisi_hikey_usb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/misc/hisi_hikey_usb.c b/drivers/misc/hisi_hikey_usb.c index cc93569e601c..989d7d129469 100644 --- a/drivers/misc/hisi_hikey_usb.c +++ b/drivers/misc/hisi_hikey_usb.c @@ -168,10 +168,7 @@ static int hisi_hikey_usb_parse_kirin970(struct platform_device *pdev, hisi_hikey_usb->reset = devm_gpiod_get(&pdev->dev, "hub_reset_en_gpio", GPIOD_OUT_HIGH); - if (IS_ERR(hisi_hikey_usb->reset)) - return PTR_ERR(hisi_hikey_usb->reset); - - return 0; + return PTR_ERR_OR_ZERO(hisi_hikey_usb->reset); } static int hisi_hikey_usb_probe(struct platform_device *pdev)