Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1018150pxk; Fri, 18 Sep 2020 01:20:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBN8Yj6K4ZhqtF1MdzwjoSWOkIGzsI0R7vvi/gjnngrLpCDZRQJUjc4U6epQw2Lp//OVUl X-Received: by 2002:a50:a2e6:: with SMTP id 93mr35763187edm.147.1600417248923; Fri, 18 Sep 2020 01:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600417248; cv=none; d=google.com; s=arc-20160816; b=gobz58LGcjEHlNPJNYWMNc73CHdUczO72BSWGvl+R1ypKb7TIbvcAmc3HBy3TEctg0 cTkalyUWhTbBafau+2oVoxn2CfQDVjWwG0Oy3e00IKhAfvT9y7Yvo7+uN0d0LZF+57O7 IOQ0gqaydMbRxz3ed6QMAybj87iWvVcaGMW/fA8FsyrRhkqEsm5JXyOb7irTAwX9tryd l7vwSf+IV/FEaoFGjYp4zF9Tkhh3ejHkFIaEW/SA/lQoIV4RWlHUfWDfnVr2yZ4WXYBY n1TVPCYmAEWXyRBvIBQRzW55BPBZSUbI3RLDju+i31dRuhUjDyiI3q98cyguydDGrGkC FOoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:mime-version:message-id:date:subject:cc:from; bh=z1brydv7jhLdBi55bDzDQbPRMak/M3/WJn5+18bDn18=; b=OZPm75eaFqNav7CbEltSW+Y2x6TM3RHBltsS2FCkDrsRtrxyt8IXHYcLQ7hS/oU8aK RXslWjtDIl23WSODtAYY7ev/H93SiZuIp9nYPZJd3Q8uLTAJ5o2KvpZdPj+yAG9OJBQs a7TRLnu91AZPXvuOA8iPT1Q9MQ92yridsvCjexa7h+QufvZaIFOV4h0R2FqaubiTzDuG 7r973SgJcehwsAGwHUjguqXowyLruJ+szOm1r+nSZJHgxSUGdSJDcv8jG7wQ5ifmTEQc YCxFzz183/sCxkFde4ob6bZb5TD2Jakn1D3J71KI1CXjFR71AwDp9LVUW8ryBPelyEDe mu4Q== 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 k15si1777616eji.77.2020.09.18.01.20.25; Fri, 18 Sep 2020 01:20:48 -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 S1726860AbgIRIFh (ORCPT + 99 others); Fri, 18 Sep 2020 04:05:37 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13292 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726280AbgIRIFh (ORCPT ); Fri, 18 Sep 2020 04:05:37 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 0E486653FFD84CAC8FEA; Fri, 18 Sep 2020 16:05:34 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Fri, 18 Sep 2020 16:05:24 +0800 From: Wang ShaoBo CC: , , , , , , Subject: [PATCH -next] ARM: zx: Use devm_platform_ioremap_resource() Date: Fri, 18 Sep 2020 16:04:50 +0800 Message-ID: <20200918080451.31938-1-bobo.shaobowang@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make use of devm_platform_ioremap_resource() provided by driver core platform instead of duplicated analogue. dev_err() is removed because it has been done in devm_ioremap_resource(). Signed-off-by: Wang ShaoBo --- arch/arm/mach-zx/zx296702-pm-domain.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c index 7a08bf9dd792..8ddc94530d5d 100644 --- a/arch/arm/mach-zx/zx296702-pm-domain.c +++ b/arch/arm/mach-zx/zx296702-pm-domain.c @@ -152,7 +152,6 @@ static struct generic_pm_domain *zx296702_pm_domains[] = { static int zx296702_pd_probe(struct platform_device *pdev) { struct genpd_onecell_data *genpd_data; - struct resource *res; int i; genpd_data = devm_kzalloc(&pdev->dev, sizeof(*genpd_data), GFP_KERNEL); @@ -162,17 +161,9 @@ static int zx296702_pd_probe(struct platform_device *pdev) genpd_data->domains = zx296702_pm_domains; genpd_data->num_domains = ARRAY_SIZE(zx296702_pm_domains); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "no memory resource defined\n"); - return -ENODEV; - } - - pcubase = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(pcubase)) { - dev_err(&pdev->dev, "ioremap fail.\n"); + pcubase = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(pcubase)) return -EIO; - } for (i = 0; i < ARRAY_SIZE(zx296702_pm_domains); ++i) pm_genpd_init(zx296702_pm_domains[i], NULL, false); -- 2.17.1