From: pierre kuo <vichy.kuo@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: rafael@kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] driver core: platform: provide devm_platform_iounremap_resource
Date: Mon, 5 Oct 2020 23:23:18 +0800 [thread overview]
Message-ID: <CAOVJa8G+RMYvV6hU1cuJStRBM=7BbA7s1sXZavKs9OhHY8kaZw@mail.gmail.com> (raw)
In-Reply-To: <20201004164745.GA196660@kroah.com>
hi Greg:
> Why are you adding new functions but not actually calling them anywhere?
Below patch introduce a single helper, devm_platform_ioremap_resource,
which combines
platform_get_resource() and devm_ioremap_resource(). But there is no
single helper to release
those resources in driver removing stage.
https://lore.kernel.org/lkml/20190215152507.31066-2-brgl@bgdev.pl/
That means driver owner still need to call below (*) and (**) for
releasing resource.
Therefore, this patch adds a single release helper that can be paired with
devm_platform_ioremap_resource.
Appreciate ur kind help,
foo_probe(pdev)
{
iomem = devm_platform_ioremap_resource(pdev, 0);
....
}
foo_remove(pdev)
{
devm_iounmap(iomem); (*)
devm_release_mem_region(dev, res->start, size); (**)
........................
}
next prev parent reply other threads:[~2020-10-05 15:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-20 11:38 [PATCH 1/2] lib: devres: provide devm_iounremap_resource() pierre Kuo
2020-09-20 11:38 ` [PATCH 2/2] driver core: platform: provide devm_platform_iounremap_resource pierre Kuo
2020-09-29 6:21 ` pierre kuo
2020-10-02 13:45 ` Greg KH
2020-10-04 16:21 ` pierre kuo
2020-10-04 16:47 ` Greg KH
2020-10-05 15:23 ` pierre kuo [this message]
2020-10-05 15:31 ` Greg KH
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='CAOVJa8G+RMYvV6hU1cuJStRBM=7BbA7s1sXZavKs9OhHY8kaZw@mail.gmail.com' \
--to=vichy.kuo@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).