Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp339739pxb; Tue, 31 Aug 2021 23:28:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzaA8/QP3LTgEQa8ly+2ZKoP64UVyFy8I+qbTrdfUxzQuEkIN2dnFBlS6LuMhxSd6PzNLr X-Received: by 2002:a02:c7c6:: with SMTP id s6mr6406080jao.34.1630477729569; Tue, 31 Aug 2021 23:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630477729; cv=none; d=google.com; s=arc-20160816; b=nWlaw+8Xp+c/k3ThOK5E8j1fwIiWOtoNnCzVtOVfM3AjKXyOCgPTuEU4eUimbwvICg y7VYHH6VakHrFqM/TDfQJI9Gklu/RZpb8MOkVC4xxGR0r/qhvxWZj96dTuKvvikaf6Yz 0NblqdGDeBk4MXkms96OLwqaBp3if9IRTCJrVruCsf3G1lMfh7ANUrTNtk1lqDodszu2 mzWhfhE0bcGRjkDcCdqAd1KY3ZteAAtRiSrLLB5kqNwhcxxkJDG/G7fXFr4a67aCALmK yJxVO2udr0Je3Pd2ILnPHRDdrybQtE/sGTrHKe0cEwweX5hMlyBR2gzt5vNN64Cy/n/t U68Q== 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=v73bYGiG6h4s2GnGAyno39fhGORvFID6boFewqVnlKk=; b=RueeioXA0bC37cLe6gqTDgwV6yFMdvn6ZiKTNgOkJ32HaABhawqbbpMNuuveuLwGuB guWmawiSwzw3BuyBT15eBlwS5VoE0u6PGVqvLjtAXaMyizpjPCB6hxITzuCyPLhlaZbM 76DBePPhr1qs3a24KNTf699gHJaJnMWREhZPGwF5Ak15VeS6/ghrPQi0atc8spEev4X5 sojjAl536loB1mMr2CiQldRBSieI4mepp+A3lLDv2fj0OAvYN88X4FXMfV/isBQN+2po FqtjLRKlRigg9bDGIEUoSkvZl6PFyb78ZGQW4iAz9N3X8c3+mSNaRdj/7omKTZtNiOy8 cXUQ== 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 p20si18276036iog.74.2021.08.31.23.28.38; Tue, 31 Aug 2021 23:28:49 -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 S242409AbhIAF5a (ORCPT + 99 others); Wed, 1 Sep 2021 01:57:30 -0400 Received: from mx21.baidu.com ([220.181.3.85]:53522 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S242377AbhIAF52 (ORCPT ); Wed, 1 Sep 2021 01:57:28 -0400 Received: from BJHW-Mail-Ex11.internal.baidu.com (unknown [10.127.64.34]) by Forcepoint Email with ESMTPS id CA5AAACEF784CE2ECCE6; Wed, 1 Sep 2021 13:56:30 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex11.internal.baidu.com (10.127.64.34) 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:30 +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:30 +0800 From: Cai Huoqing To: CC: Fabien Dessenne , Mauro Carvalho Chehab , Jean-Christophe Trotin , , Subject: [PATCH] media: sti: Make use of the helper function devm_platform_ioremap_resource() Date: Wed, 1 Sep 2021 13:56:23 +0800 Message-ID: <20210901055624.7779-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) 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/sti/bdisp/bdisp-v4l2.c | 3 +-- drivers/media/platform/sti/hva/hva-hw.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c index 6413cd279125..7d467f2ba072 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c @@ -1315,8 +1315,7 @@ static int bdisp_probe(struct platform_device *pdev) mutex_init(&bdisp->lock); /* get resources */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - bdisp->regs = devm_ioremap_resource(dev, res); + bdisp->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(bdisp->regs)) { ret = PTR_ERR(bdisp->regs); goto err_wq; diff --git a/drivers/media/platform/sti/hva/hva-hw.c b/drivers/media/platform/sti/hva/hva-hw.c index 30fb1aa4a351..15e8f83b1b56 100644 --- a/drivers/media/platform/sti/hva/hva-hw.c +++ b/drivers/media/platform/sti/hva/hva-hw.c @@ -298,15 +298,13 @@ static unsigned long int hva_hw_get_ip_version(struct hva_dev *hva) int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva) { struct device *dev = &pdev->dev; - struct resource *regs; struct resource *esram; int ret; WARN_ON(!hva); /* get memory for registers */ - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - hva->regs = devm_ioremap_resource(dev, regs); + hva->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hva->regs)) { dev_err(dev, "%s failed to get regs\n", HVA_PREFIX); return PTR_ERR(hva->regs); -- 2.25.1