mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 08:42:10 +00:00
kernel/resource: simplify API __devm_release_region() implementation
Simplify __devm_release_region() implementation by dedicated API devres_release() which have below advantages than current __release_region() + devres_destroy(): It is simpler if __devm_release_region() is undoing what __devm_request_region() did, otherwise, it can avoid wrong and undesired __release_region(). Link: https://lkml.kernel.org/r/20241017-release_region_fix-v1-1-84a3e8441284@quicinc.com Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
afdbcfc779
commit
bcaadbb2ee
@ -1683,8 +1683,7 @@ void __devm_release_region(struct device *dev, struct resource *parent,
|
||||
{
|
||||
struct region_devres match_data = { parent, start, n };
|
||||
|
||||
__release_region(parent, start, n);
|
||||
WARN_ON(devres_destroy(dev, devm_region_release, devm_region_match,
|
||||
WARN_ON(devres_release(dev, devm_region_release, devm_region_match,
|
||||
&match_data));
|
||||
}
|
||||
EXPORT_SYMBOL(__devm_release_region);
|
||||
|
Loading…
Reference in New Issue
Block a user