From: Greg KH <gregkh@linuxfoundation.org>
To: Dejin Zheng <zhengdejin5@gmail.com>
Cc: rafael@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers: provide devm_platform_ioremap_and_get_resource()
Date: Fri, 13 Mar 2020 18:56:08 +0100 [thread overview]
Message-ID: <20200313175608.GA2306127@kroah.com> (raw)
In-Reply-To: <20200313171902.31836-1-zhengdejin5@gmail.com>
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 <zhengdejin5@gmail.com>
> ---
> 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
prev parent reply other threads:[~2020-03-13 17:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-13 17:19 Dejin Zheng
2020-03-13 17:56 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200313175608.GA2306127@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=zhengdejin5@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®