Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp322562pxb; Tue, 31 Aug 2021 22:59:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN9aDv74NEiS6I2lnrjgURez14hrLlJwFp8nAvEYAWHHuAkyU59ZaYXifsQksL/Llt4AfN X-Received: by 2002:a05:6402:1d8b:: with SMTP id dk11mr34280710edb.267.1630475969570; Tue, 31 Aug 2021 22:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630475969; cv=none; d=google.com; s=arc-20160816; b=BWKahYij9Q8nKrASMchDSpDy2Ss0m8N3HRYBJvgpmFJFqZGhA7IbQ2sBNBz9OzOuET bJsgfcE6OJmppgfdlMnMSCShNQuC8BnpGH90xHcvR6fHnH93k3Soc02PtwTonFN9Upj/ zUbsxmaRCgp7dGFmJzhtMNhGVURbcnrPv5nwchub95OU/deAGI7Wa07LDDXnnJ8BGLIl HWJ+W9XeRe3Z9PKCebOxDY+4pHvUQaZTX6WS0hiHKTgwd+L/Ug/LW5uaFoJwmVtxKFbM 0QjdjHyUqOq2dJdh2jMHLN+/Km0ByrLfZlpFQUl+0zRwW7/uH7q4OIY8aX8iVxU8v7AK mvwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=ro+lN7L39YODr7qAomzVyoOdDvKlQ/z5EnEN0eG4+eU=; b=PK/4lQlVCDwztzmfyJnrCYd38mXr5MU9ULaTzspvKX8qh9rvYrHNCT0+vS1wOxmZ26 N6DaksXvUIezR97bS+TFOJ4RXWfG2TK2j9uLyZxG32UU/FGx9B2qUHQmAVpEAE1fBfJX DF5n9fsz/ludn/wo4uTkELXAUyqF/aZw7vLTLaCGOxnTc0nXt8xTFn1bSAp5DY3thG52 zZvIEfuALOpiXhvXKkSQ6FOmE8B5E024UdeMw37pOC34B3cYD66J6LYQYQRX8yHX1+a3 lJn7poubxbiqowM8JhnLnKL/3HpBXJhcH10DWTjIu5vBdlLqV2PPzfJv2wZryUqO/WhD cyTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z8si20471398edx.190.2021.08.31.22.59.06; Tue, 31 Aug 2021 22:59:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242441AbhIAF57 (ORCPT + 99 others); Wed, 1 Sep 2021 01:57:59 -0400 Received: from mx20.baidu.com ([111.202.115.85]:54084 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S242438AbhIAF56 (ORCPT ); Wed, 1 Sep 2021 01:57:58 -0400 Received: from BJHW-Mail-Ex15.internal.baidu.com (unknown [10.127.64.38]) by Forcepoint Email with ESMTPS id 99AEA8CAD256AF771766; Wed, 1 Sep 2021 13:57:00 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex15.internal.baidu.com (10.127.64.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 1 Sep 2021 13:57:00 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 1 Sep 2021 13:56:59 +0800 From: Cai Huoqing To: CC: Maxime Ripard , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Yong Deng , , , , Subject: [PATCH] media: sunxi: Make use of the helper function devm_platform_ioremap_resource() Date: Wed, 1 Sep 2021 13:56:53 +0800 Message-ID: <20210901055654.7979-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BJHW-Mail-Ex11.internal.baidu.com (10.127.64.34) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex15_2021-09-01 13:57:00:553 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing --- drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c | 4 +--- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 4 +--- drivers/media/platform/sunxi/sun8i-di/sun8i-di.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c index 94e98e470aff..80a10f238bbe 100644 --- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c +++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c @@ -154,7 +154,6 @@ static int sun4i_csi_probe(struct platform_device *pdev) struct v4l2_subdev *subdev; struct video_device *vdev; struct sun4i_csi *csi; - struct resource *res; int ret; int irq; @@ -179,8 +178,7 @@ static int sun4i_csi_probe(struct platform_device *pdev) media_device_init(&csi->mdev); csi->v4l.mdev = &csi->mdev; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - csi->regs = devm_ioremap_resource(&pdev->dev, res); + csi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(csi->regs)) return PTR_ERR(csi->regs); diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c index 4b8d66fec3cf..fc96921b0583 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c @@ -833,13 +833,11 @@ static const struct regmap_config sun6i_csi_regmap_config = { static int sun6i_csi_resource_request(struct sun6i_csi_dev *sdev, struct platform_device *pdev) { - struct resource *res; void __iomem *io_base; int ret; int irq; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - io_base = devm_ioremap_resource(&pdev->dev, res); + io_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(io_base)) return PTR_ERR(io_base); diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c index 671e4a928993..aa65d70b6270 100644 --- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c +++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c @@ -803,7 +803,6 @@ static int deinterlace_probe(struct platform_device *pdev) { struct deinterlace_dev *dev; struct video_device *vfd; - struct resource *res; int irq, ret; dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); @@ -825,8 +824,7 @@ static int deinterlace_probe(struct platform_device *pdev) return ret; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - dev->base = devm_ioremap_resource(&pdev->dev, res); + dev->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(dev->base)) return PTR_ERR(dev->base); -- 2.25.1