Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1988691ybh; Fri, 13 Mar 2020 10:57:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsBZYijIunAWV4aG0hJ+1wLsdFSh659ffo7OV7yLTOGxOH/INuePdJW8/WXCtLqO8ee1eJZ X-Received: by 2002:a05:6830:1e09:: with SMTP id s9mr11530855otr.149.1584122222787; Fri, 13 Mar 2020 10:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584122222; cv=none; d=google.com; s=arc-20160816; b=iB1Kq8gUd/LWEQksBCYuFhpvwEpcGZFkrjK1g5afVe8oSu3zujO/pueLBy80hLofev 8+5REAOGAvCbsvoFgFkn24QWD2Z5k3ShSSDrcj4xQ/IhYxmFeO6CbKISffpTqnk5VzmY R0ftNEZzPbXmzNmfIb84r8qiEcU7uPVGhkSylInTHPka6rLvayLNqS2k2lW4o6GrAPZj xMGd8lDwvRKFWAimyKcF+RtdGaSsld3nEhMhCZ6rdOZ9vgsVdVMaB8C/vIpQn33Yyk4e 9VwMrD8pUv3hMNCLte/67D8dgzOFT41hfxYiw6r6nXl2CBFohNTKxzJ71uJk4azulxue borQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=KnWNT4If0fVtuwS/9yVCC4cxKzX24oK5yeF+aDllH9Y=; b=eytGEkK30Sak+gi/qJ5ABsqc427/6RNimNnsAYgu4+rUYjEvnom4HV05pH6pDh6zZV lrijl5rGmtTLevr7JKwp6LW6n0KXHDPpTktAFVmb9bH9pKvr3TSKZbFIR/Gn6rqL9UF1 Oueti+ZFibBztCibxpmZfVScBzFrfPq8sWkvy/0Y6m/L18hk6BLgSa71ULFZu327D8VE yFXOmK2PmcDca/kYELO0yKrG8X100mub+D2MzAo9rPXkbdXiCICiKo+nEtw5Z4SBcRvK lsKktjH5thTNYDftKV5k2g3putM/AvWLiZOsQUoq0HDYFYgqIv1mw63xzBDYSGGeQ0x3 3a4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pLoGD2BL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x136si4582234oif.122.2020.03.13.10.56.50; Fri, 13 Mar 2020 10:57:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pLoGD2BL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727334AbgCMR4L (ORCPT + 99 others); Fri, 13 Mar 2020 13:56:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:39822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbgCMR4L (ORCPT ); Fri, 13 Mar 2020 13:56:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 5A57320746; Fri, 13 Mar 2020 17:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584122170; bh=AAEHbdTZnL6d7Gr3nuqbX2Ida62RwmUvzgcJbhcDcZA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pLoGD2BLHuWnmuwR3FCgqZMnqxYZ0X2OEV6TzKJA/wugGHSexcEQs6q00affCU/37 kzERWpO9BMPm0/E+H28LUYKY1l5WV5VeMf5cxAVYzZY33jq9g8DkvxDIHAVAJN2XhM cmCusoj2BI6gVXH0z0fyi+bOFKoCAHiQBxyDYYYg= Date: Fri, 13 Mar 2020 18:56:08 +0100 From: Greg KH To: Dejin Zheng Cc: rafael@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers: provide devm_platform_ioremap_and_get_resource() Message-ID: <20200313175608.GA2306127@kroah.com> References: <20200313171902.31836-1-zhengdejin5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200313171902.31836-1-zhengdejin5@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 14, 2020 at 01:19:02AM +0800, Dejin Zheng wrote: > Since commit "drivers: provide devm_platform_ioremap_resource()", > It was wrap platform_get_resource() and devm_ioremap_resource() as > single helper devm_platform_ioremap_resource(). but now, many drivers > still used platform_get_resource() and devm_ioremap_resource() > together in the kernel tree. The reason can not be replaced is they > still need use the resource variables obtained by platform_get_resource(). > so provide this helper. > > Signed-off-by: Dejin Zheng > --- > drivers/base/platform.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/drivers/base/platform.c b/drivers/base/platform.c > index 7fa654f1288b..b3e2409effae 100644 > --- a/drivers/base/platform.c > +++ b/drivers/base/platform.c > @@ -62,6 +62,24 @@ struct resource *platform_get_resource(struct platform_device *dev, > EXPORT_SYMBOL_GPL(platform_get_resource); > > #ifdef CONFIG_HAS_IOMEM > +/** > + * devm_platform_ioremap_and_get_resource - call devm_ioremap_resource() for a > + * platform device and get resource > + * > + * @pdev: platform device to use both for memory resource lookup as well as > + * resource management > + * @index: resource index > + * @res: get the resource > + */ > +void __iomem * > +devm_platform_ioremap_and_get_resource(struct platform_device *pdev, > + unsigned int index, struct resource **res) > +{ > + *res = platform_get_resource(pdev, IORESOURCE_MEM, index); > + return devm_ioremap_resource(&pdev->dev, *res); > +} > +EXPORT_SYMBOL_GPL(devm_platform_ioremap_and_get_resource); > + > /** > * devm_platform_ioremap_resource - call devm_ioremap_resource() for a platform > * device > -- > 2.25.0 > I can not take new api functions without some real users of the function at the same time. Please make a patch series modifing drivers to use this new function and I will be glad to review it then. thanks, greg k-h