From patchwork Fri Aug 11 02:11:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhangzekun (A)" X-Patchwork-Id: 13350216 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 482D3EB64DD for ; Fri, 11 Aug 2023 07:26:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C4F5910E677; Fri, 11 Aug 2023 07:26:22 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1912B10E044 for ; Fri, 11 Aug 2023 02:19:43 +0000 (UTC) Received: from kwepemi500019.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RMS895b2fztRnx; Fri, 11 Aug 2023 10:16:09 +0800 (CST) Received: from huawei.com (10.175.112.208) by kwepemi500019.china.huawei.com (7.221.188.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 11 Aug 2023 10:19:40 +0800 From: Zhang Zekun To: , , , Subject: [PATCH] drm: xlnx: Use devm_platform_ioremap_resource_byname() helper function Date: Fri, 11 Aug 2023 10:11:21 +0800 Message-ID: <20230811021121.60027-1-zhangzekun11@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.208] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500019.china.huawei.com (7.221.188.117) X-CFilter-Loop: Reflected X-Mailman-Approved-At: Fri, 11 Aug 2023 07:26:19 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zhangzekun11@huawei.com, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" platform_get_resource_byname() and devm_ioremap_resource() can be replaced by devm_platform_ioremap_resource_byname(), which can simplify the code logic a bit, No functional change here. Signed-off-by: Zhang Zekun --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 3b87eebddc97..2b731f3eea54 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -1228,7 +1228,6 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub) { struct platform_device *pdev = to_platform_device(dpsub->dev); struct zynqmp_disp *disp; - struct resource *res; int ret; disp = kzalloc(sizeof(*disp), GFP_KERNEL); @@ -1238,22 +1237,19 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub) disp->dev = &pdev->dev; disp->dpsub = dpsub; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "blend"); - disp->blend.base = devm_ioremap_resource(disp->dev, res); + disp->blend.base = devm_platform_ioremap_resource_byname(pdev, "blend"); if (IS_ERR(disp->blend.base)) { ret = PTR_ERR(disp->blend.base); goto error; } - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "av_buf"); - disp->avbuf.base = devm_ioremap_resource(disp->dev, res); + disp->avbuf.base = devm_platform_ioremap_resource_byname(pdev, "av_buf"); if (IS_ERR(disp->avbuf.base)) { ret = PTR_ERR(disp->avbuf.base); goto error; } - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "aud"); - disp->audio.base = devm_ioremap_resource(disp->dev, res); + disp->audio.base = devm_platform_ioremap_resource_byname(pdev, "aud"); if (IS_ERR(disp->audio.base)) { ret = PTR_ERR(disp->audio.base); goto error;