Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1024538pxk; Fri, 18 Sep 2020 01:34:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+DKYAy2HyO2G+OzTifAp6LLmZH0XN00dg5IM/g64p8hQcO0jvPgM9jgsEcm8ZMci8wlR2 X-Received: by 2002:a05:6402:1495:: with SMTP id e21mr36578574edv.146.1600418079149; Fri, 18 Sep 2020 01:34:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600418079; cv=none; d=google.com; s=arc-20160816; b=CL68zcOMdX/7wcfvfrNxySQcTsUewQqfcB+E8dp9VakYhupt7fLx3pKuZUxyQVO9Rm blDjxYW/lrpzJQ7ubFHaLO4qwUq73P/3ouuqyaIjeDockJRgDOVYQgAbYhiDLPhQQgSg ZxzsxYh5yddN2wCxHFJXILBR70/EzFgHLgU8x+Upf9ZDpFNnUhPs4M+zQVmfBa9b/aLt 91tSxkB/lQwY/j1Ey/75DNeAX9z69fleMuW+EqUJTcfhYK8NV8yGwRyZB+048dBr7lZU 53SNoLxZSzW8BYPqwHEAIhiemeuaX9vOmuL55pYp+LEWaiwttAvI0CFfY4jp5PLX+T/x En4g== 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=9arV5ac3/ao0J6K+y7l253aSOnjdAtuH/B7d8oJIV/c=; b=KqS5a2mlnJ171gUcpp8maI9NDIp4o/JTGRLy7iX/z59+dQqXPVDQV6on0guOFjgwJp 3wmyNSqn3Z4uFlO8wYhXG3VY7OG/J60ovB+iFJ1QB01QbXUJlukWFyJc83IEZbF/PA7y xdMVBHzR813nyNGTrWpEqSIORz9x5T1Mkem+lZv/H8PXvbc0v5XUy+vS/6oiPLRnzdNp UOAZ7ZEiSC75jK0I0JcUHQwER4PYAwGXSEhpSFohFqG9OX80rS0n3xzYowOPXHU/c8YB Ou+u/5KDgxXCdsYrccAoQ7qCktokWB0LJsbUJVjkLpt/wifse0fePkz98qFLNSvdf0/O Y+7w== 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 m21si1723447ejq.199.2020.09.18.01.34.15; Fri, 18 Sep 2020 01:34:39 -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 S1726826AbgIRIca (ORCPT + 99 others); Fri, 18 Sep 2020 04:32:30 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13253 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726304AbgIRIca (ORCPT ); Fri, 18 Sep 2020 04:32:30 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 43E1D56B5A0EC57846F3; Fri, 18 Sep 2020 16:32:28 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Fri, 18 Sep 2020 16:32:17 +0800 From: Wang ShaoBo CC: , , , , , , , Subject: [PATCH -next] iio: adc: stm32-dfsdm: Use devm_platform_get_and_ioremap_resource() Date: Fri, 18 Sep 2020 16:31:42 +0800 Message-ID: <20200918083142.32816-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_get_and_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 --- drivers/iio/adc/stm32-dfsdm-core.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c index 0b8bea88b011..42a7377704a4 100644 --- a/drivers/iio/adc/stm32-dfsdm-core.c +++ b/drivers/iio/adc/stm32-dfsdm-core.c @@ -226,16 +226,13 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev, if (!node) return -EINVAL; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "Failed to get memory resource\n"); - return -ENODEV; - } - priv->dfsdm.phys_base = res->start; - priv->dfsdm.base = devm_ioremap_resource(&pdev->dev, res); + priv->dfsdm.base = devm_platform_get_and_ioremap_resource(pdev, 0, + &res); if (IS_ERR(priv->dfsdm.base)) return PTR_ERR(priv->dfsdm.base); + priv->dfsdm.phys_base = res->start; + /* * "dfsdm" clock is mandatory for DFSDM peripheral clocking. * "dfsdm" or "audio" clocks can be used as source clock for -- 2.17.1