Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp704285pxk; Wed, 23 Sep 2020 13:54:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtYmbBU/7/w6vlPYs3CntgGpkbgAZ4UaQHRdDI1e6ZYxg9nHjQiOxWWqZ5Dt178ifUtRLI X-Received: by 2002:a17:906:c2c5:: with SMTP id ch5mr1469755ejb.183.1600894472648; Wed, 23 Sep 2020 13:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600894472; cv=none; d=google.com; s=arc-20160816; b=FMiEeVBMlJvFoYHFoRwgS1JzMvCnJZDCaZGePGDZ1Kwz2gh6pQRtk+4P62Dz7/FNtP W0ohxrAn46qzRHy27FL4PLlDUP6HQHJ251qsVlzH30aU4M931N7WEKrAnQa0+AzQk+rh ZrBX/Kpvs0rk1T5D1N4pqxvJ6my5TMKUdElPtN6ZG4ggT+9zdTi8RNbCv5HFgKR0mTXp 3hc7kpC3Rgwywb2Od7wGtVIOMskcBxwy30/j31gqmNn+l5apVyDeHyMdGweWPvxPDsyx N3JY7VzGPmHs/dNp/PZQba3IWxQLsyTQ2VxfMtf1Nw+xZetch5+QSTTDq2wpyIzxo3Ub +DGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Fsvo88mo6KUJ7+PnrwUR2qdY8Nzu90WZdU4oRhPzxkw=; b=uHi13B89IvsgSe+Jt9+qnnaws2vTBb0Rk/YSRuexT6VgnaBJsr4YDR2mrFWbycgAyO i9MZYvB5hs5CQ57FI/0EyDwXjJMkTQuWcIEp43IDhirHn/kQoYa5/4oCsh/t6csbnXTA icMpy29wuAF+WzRnV4wm9ZMc8qKWQqMSe3fcIIyGqohrjP+QNyi9KaGxS8AB/zRPgtYZ IMxqfbLhEaiSsQQ93u1u4jm04xZC4sa/g3/J68lsIkjEcP9gl3y4KdVZl6cylQFHQfvN 6nS8ly20MGJ758pcVa+xB1K2tXsViXeBnOKQsHAJL2I8vew+K11K292lm5T5YJuSECvA VyKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RM+T9ohJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z18si706123edm.355.2020.09.23.13.54.09; Wed, 23 Sep 2020 13:54:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=RM+T9ohJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726650AbgIWUwb (ORCPT + 99 others); Wed, 23 Sep 2020 16:52:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:40918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726265AbgIWUwb (ORCPT ); Wed, 23 Sep 2020 16:52:31 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 331EC214F1; Wed, 23 Sep 2020 20:52:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600894350; bh=Q06p8Et9US/NfgUeEtjZnh3mkPhqpZz0306QBf0WJPs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RM+T9ohJJqm2UxXudwE51CP564QadUXTGiUXONJqMn3Hc94O2xnXlDbroE6uOaHaz YqrzHaRhJEkPu1qY/5Wcn3TubfoxstyN/Btz2zdBN/K6SoDLKvtCV7jcuX5Fq+pnfB p/qsWoX5SraJZXlEC5GLvkb3vuOOYAa5VbgpCCe8= Date: Wed, 23 Sep 2020 21:52:25 +0100 From: Jonathan Cameron To: Wang ShaoBo Cc: , , , , , , Subject: Re: [PATCH -next] iio: adc: at91-sama5d2_adc: Use devm_platform_get_and_ioremap_resource() Message-ID: <20200923215158.1d3d73fc@archlinux> In-Reply-To: <20200918082837.32610-1-bobo.shaobowang@huawei.com> References: <20200918082837.32610-1-bobo.shaobowang@huawei.com> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 18 Sep 2020 16:28:37 +0800 Wang ShaoBo wrote: > Make use of devm_platform_get_and_ioremap_resource() provided by > driver core platform instead of duplicated analogue. > > Signed-off-by: Wang ShaoBo Hi, Thanks. As far as I can see this boilerplate removal with no side effects, so applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to poke at it. Thanks, Jonathan > --- > 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)