From patchwork Wed Sep 14 13:37:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 12976153 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 4A857C6FA82 for ; Wed, 14 Sep 2022 13:30:28 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :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=k/eZWPGr28WvnxG7tuhLx4v5lqP2Ecbkr+vslSuF0Qc=; b=4geuojpinc9RWG +hK62NCJ6lKTFegyCpzYQe3Nn2W+q6KPuh9ae4rpSyLUwixE7aHtBh0LTCdzzO0oo++Z/mxxSVkUj 3KP8o9je7zmliO+IceMG193cnsRYD/6my25l+vHyF/GeCStUS0aNJg2HRh0FRhVsMpz4mj3OcJFRa ugtkIWIeSFtvvZc9cuanLhgtlH6CpCHF+uW1N/u4jHVABrKpLdHA+3BkQZe4JwhJi7LLUA1e7CqOi SX0VOHZgUCo8DQMlKL9jNPet1aBNqM8HlZADTOicfH7SeMAcMt7MfUwYWAf7V3n7xFdNUQTe2fvER 0gtSKKyotmXo2UpO26MQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYSTD-000tRm-2E; Wed, 14 Sep 2022 13:30:27 +0000 Received: from szxga03-in.huawei.com ([45.249.212.189]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYST8-000t5u-Gt; Wed, 14 Sep 2022 13:30:24 +0000 Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MSLkL6KHjzHnV3; Wed, 14 Sep 2022 21:28:10 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 14 Sep 2022 21:30:13 +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.2375.24; Wed, 14 Sep 2022 21:30:12 +0800 From: Yang Yingliang To: , CC: , , , Subject: [PATCH -next] phy: rockchip-snps-pcie3: Use devm_platform_get_and_ioremap_resource() Date: Wed, 14 Sep 2022 21:37:28 +0800 Message-ID: <20220914133728.3781160-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: dggems706-chm.china.huawei.com (10.3.19.183) 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-20220914_063022_837906_519BEF15 X-CRM114-Status: UNSURE ( 9.09 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang --- drivers/phy/rockchip/phy-rockchip-snps-pcie3.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c index 1917edda6b47..a8d5914c5ac5 100644 --- a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c +++ b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c @@ -231,15 +231,13 @@ static int rockchip_p3phy_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct rockchip_p3phy_priv *priv; struct device_node *np = dev->of_node; - struct resource *res; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->mmio = devm_ioremap_resource(dev, res); + priv->mmio = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(priv->mmio)) { ret = PTR_ERR(priv->mmio); return ret;