Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1023427pxk; Fri, 18 Sep 2020 01:32:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ5mxgw1Ccm1ZVgr/Y2s+2aMVxSD7rfnGe7OYFgPAt39+tDTtVXM3ltgob6hK11Y7e2DVv X-Received: by 2002:a17:906:f1cf:: with SMTP id gx15mr34000536ejb.241.1600417934049; Fri, 18 Sep 2020 01:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600417934; cv=none; d=google.com; s=arc-20160816; b=JfdRCKzu2ZmREpQyTT7sb5GBGy+o/5lTwv/2ZlzAD1heU9sv91/RQeuDkXOVInpDFC 7lh4/DjI778TqB4I/xagI+kIHlVUYmCOtm3tndpAwt82QLgDC74MWciZcleB/bOQDUz+ 5IqzzCypTo9kxkZ7BS6lsbRAcuQhJwyunZi4CNU7TaH4qQpqTYfCnevG2J0GCFkRB5Dw DnF6H7AJXnxBAFjphR6Edcafbxbsn+8ZK6uDHPp04f5TA138yBey2cB8IRg4HEFdM5H/ 6g23MnjIaSq9ktyM/tahi9n4n3uZdXsaC4fOxgPVP2m9QaR1X56dm/LF8YN8TmIqGhK9 VVZw== 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=zjV1MOMcyOh6qQ8SYKBkkSTiRdFXGkNZlS8bCMtsc/E=; b=JM5kmi76l5EBVuAPAg420+whBN/OuwZddFCc8wrG46iDFJj4fQUmJJt+sMLvWGwVTA 4rpKaQFdAhjFdJhkFUrxhpUQD2JE78JXsYGp9je24M0a0oWbgru8QLcia0oQjRekakiu XaOq6fCoKgYqrPwBHbjErfy0q4cwyPZppAPalfBBSP+Y1BqtmDZlObUu4cvwbDhqfyGq 06vDaZ8clXO1u+Un2iR0P4wpw6qbuuDzN9mwS31HRPz70X7Wokdu5Oc834jsR87yZRR/ /y6qkpIqVqlkBq4u3afGpVK7BtkaH7zTFvpXmETNX30VAIDHOIw8dUzJd84S/0zlvxKe /wTQ== 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 ng5si1703849ejb.532.2020.09.18.01.31.50; Fri, 18 Sep 2020 01:32:14 -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 S1726307AbgIRI33 (ORCPT + 99 others); Fri, 18 Sep 2020 04:29:29 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13294 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725874AbgIRI33 (ORCPT ); Fri, 18 Sep 2020 04:29:29 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B7BFACCC4C283E782FBE; Fri, 18 Sep 2020 16:29:25 +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:29:15 +0800 From: Wang ShaoBo CC: , , , , , , Subject: [PATCH -next] iio: adc: at91-sama5d2_adc: Use devm_platform_get_and_ioremap_resource() Date: Fri, 18 Sep 2020 16:28:37 +0800 Message-ID: <20200918082837.32610-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. Signed-off-by: Wang ShaoBo --- drivers/iio/adc/at91-sama5d2_adc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c index de9583d6cddd..ad7d9819f83c 100644 --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c @@ -1764,17 +1764,13 @@ static int at91_adc_probe(struct platform_device *pdev) mutex_init(&st->lock); INIT_WORK(&st->touch_st.workq, at91_adc_workq_handler); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -EINVAL; + st->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); + if (IS_ERR(st->base)) + return PTR_ERR(st->base); /* if we plan to use DMA, we need the physical address of the regs */ st->dma_st.phys_addr = res->start; - st->base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(st->base)) - return PTR_ERR(st->base); - st->irq = platform_get_irq(pdev, 0); if (st->irq <= 0) { if (!st->irq) -- 2.17.1