From patchwork Thu Aug 10 13:45:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 13349481 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E254C001DB for ; Thu, 10 Aug 2023 13:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ND0alWXwHRKZl0J9ZZ6UqqM63+VLxgbD6DqASv34Ba0=; b=ciOsvQwBo/DZU8 sLE1WyDwQu4T4NuJ/MjgjxULd9gBbWYA3R3K8VPX1WvXXWA04XD48yghMjtFInMe9TZamgkRlaA78 M3pu/LpLC35O5e6PfmYMQuYUR1NhP8e09SA49P9Q5drJv5pCdJp+gnMWo70xqTvO03xs2KaXjZVhA 6XXiEwMPk1hMuqt68vHKEiyVUciBoPN5UUyBF5CzwG5YljaDTrUYacXC4dM//5oNoULVNf4xQ1NZU 1X9x0aAHXhwWKM1XtpUa+UUy8r0scQ4HR6evxVc4UbT5sz/6jfJRytjlAlVdDFDtQXU2B8l5UqwWI LzwA+2b+K1f/gCWVAJfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qU61n-007n9C-2Z; Thu, 10 Aug 2023 13:48:39 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qU61k-007n86-1m for linux-arm-kernel@lists.infradead.org; Thu, 10 Aug 2023 13:48:38 +0000 Received: from dggpemm100020.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RM7TP4HyrzCrWw; Thu, 10 Aug 2023 21:44:57 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm100020.china.huawei.com (7.185.36.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 10 Aug 2023 21:48:26 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 10 Aug 2023 21:48:26 +0800 From: Yang Yingliang To: Subject: [PATCH -next] ARM: at91: pm: Use PTR_ERR_OR_ZERO() to simplify code Date: Thu, 10 Aug 2023 21:45:27 +0800 Message-ID: <20230810134527.113788-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230810_064836_810438_C7A44AA2 X-CRM114-Status: UNSURE ( 9.04 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: claudiu.beznea@tuxon.dev, alexandre.belloni@bootlin.com, yangyingliang@huawei.com, linux@armlinux.org.uk Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to simplify code. Signed-off-by: Yang Yingliang --- arch/arm/mach-at91/pm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 1a26af0fabc7..02f36732ea75 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -1202,10 +1202,8 @@ static int __init at91_pm_get_eth_clks(struct device_node *np, return PTR_ERR(clks[AT91_PM_ETH_PCLK].clk); clks[AT91_PM_ETH_HCLK].clk = of_clk_get_by_name(np, "hclk"); - if (IS_ERR(clks[AT91_PM_ETH_HCLK].clk)) - return PTR_ERR(clks[AT91_PM_ETH_HCLK].clk); - return 0; + return PTR_ERR_OR_ZERO(clks[AT91_PM_ETH_HCLK].clk); } static int __init at91_pm_eth_clks_empty(struct clk_bulk_data *clks)