Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp704864pxk; Wed, 23 Sep 2020 13:55:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrE5EFDMXAwRyIJ5v6jVA760S54aK+Km9CJ9XsiX2oQQLrTIN2UNIpvteq/IVMF/Lwa1Be X-Received: by 2002:a17:906:4902:: with SMTP id b2mr1471211ejq.208.1600894549631; Wed, 23 Sep 2020 13:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600894549; cv=none; d=google.com; s=arc-20160816; b=RaLJivKWKi93GYqUfGyaorVWqB2eo23T1qrCGmiiOWkahAmP0Q94/hdBcdtsg9sMBI 8elz8ES2V015SWAfwO48KWFD4MranrQx42Ehq/cb1li2HWoiORN+Zu/aFWZ97fLUyXr4 Twp7hlgbsNnMQC8z/kSfyEFlLNSwwxxtM536mQSlYgxVi+kYCbzdMvYEw42CjiuQV9Pg Oc7Bfw5Xaz97SRzfEEUIOA44SrKn/yNUo5CNpIkyss35yOppCJA2ldb+VO+Ft1uG0uRo vrHmN3yLPEnxvNt/7j03biFRJn1YB1vyQuwhTjBLCgR2KPQqOMQJSIpGTyVxAX0Me8qn O/4A== 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=YjiHeDOU2vFPdaxpamsmG7PU1XdgFQUjFvQ4+yvpdPA=; b=C0fotukxFhU9IoT9S6zrLUEK7TK9GQE0nN82+HkrPyrQRARitQO2+WTPVhbhe5skrn EK5GQh4K/vNP+mt7OuNmvY2hFGeDRzDcKpQ8LWFvwWm4pthd7msOGxunPTdYwo2s26ot CcDoUKe27uKhYodFn5+pyPTZhmB/Aq9me1X3L3Hgg/Pw6+NM1dg+vgoq2Zucp+yQoTLl fIyrDgY7E/Uni5GufFk6w3vDgmYjRy6LGYR3NKhsetgTobN3HmSiy82zCMkaSGjRSVdW 9arTsrl9/YDpJqySDn3WK2ZzdFkFdct5epTapn/B6bVLiGdF5GL5stMyDU44UpOUTUaA sR7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bpKhHnhj; 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 j12si768643ejy.198.2020.09.23.13.55.25; Wed, 23 Sep 2020 13:55: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; dkim=pass header.i=@kernel.org header.s=default header.b=bpKhHnhj; 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 S1726605AbgIWUyR (ORCPT + 99 others); Wed, 23 Sep 2020 16:54:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:41812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726265AbgIWUyR (ORCPT ); Wed, 23 Sep 2020 16:54:17 -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 0FEFE214F1; Wed, 23 Sep 2020 20:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600894456; bh=4W8tkVEnVbxByODEUPomYSterl2xwqTlOxfLZTbwLt0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bpKhHnhjyQreXsGYfaJ5ArX8UDxNgxTCpzvBIGlT6fcSULxC+13epxTa19yMiz7dk KoTinHrYH2aztpNLmskjxsSYucKSLpvVRmGbw9HXCOhoyq35Pr1kgGa2eMPtIzpIgn LpoX4sLVR15oFiAlxSdXYzEQ8OVgc7xarT8UHqD8= Date: Wed, 23 Sep 2020 21:54:12 +0100 From: Jonathan Cameron To: Wang ShaoBo Cc: , , , , , , , Subject: Re: [PATCH -next] iio: adc: stm32-dfsdm: Use devm_platform_get_and_ioremap_resource() Message-ID: <20200923215357.26f8959d@archlinux> In-Reply-To: <20200918083142.32816-1-bobo.shaobowang@huawei.com> References: <20200918083142.32816-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:31:42 +0800 Wang ShaoBo wrote: > 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 Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to see if they can find any problems. Thanks, Jonathan > --- > 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