diff options
author | Dan Williams <dan.j.williams@intel.com> | 2023-06-03 08:14:11 +0200 |
---|---|---|
committer | Vishal Verma <vishal.l.verma@intel.com> | 2023-06-23 09:03:50 +0200 |
commit | 2532f41607c4308733239dd43278f8a5540f3ec7 (patch) | |
tree | 6e43c94541c871b5e8cbd60bcddad92816e79263 /drivers/dax/hmem | |
parent | dax: Introduce alloc_dev_dax_id() (diff) | |
download | linux-2532f41607c4308733239dd43278f8a5540f3ec7.tar.xz linux-2532f41607c4308733239dd43278f8a5540f3ec7.zip |
dax: Cleanup extra dax_region references
Now that free_dev_dax_id() internally manages the references it needs
the extra references taken by the dax_region drivers are not needed.
Reported-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/r/168577285161.1672036.8111253437794419696.stgit@dwillia2-xfh.jf.intel.com
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Diffstat (limited to 'drivers/dax/hmem')
-rw-r--r-- | drivers/dax/hmem/hmem.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/dax/hmem/hmem.c b/drivers/dax/hmem/hmem.c index e5fe8b39fb94..5d2ddef0f8f5 100644 --- a/drivers/dax/hmem/hmem.c +++ b/drivers/dax/hmem/hmem.c @@ -16,7 +16,6 @@ static int dax_hmem_probe(struct platform_device *pdev) struct dax_region *dax_region; struct memregion_info *mri; struct dev_dax_data data; - struct dev_dax *dev_dax; /* * @region_idle == true indicates that an administrative agent @@ -38,13 +37,8 @@ static int dax_hmem_probe(struct platform_device *pdev) .id = -1, .size = region_idle ? 0 : range_len(&mri->range), }; - dev_dax = devm_create_dev_dax(&data); - if (IS_ERR(dev_dax)) - return PTR_ERR(dev_dax); - /* child dev_dax instances now own the lifetime of the dax_region */ - dax_region_put(dax_region); - return 0; + return PTR_ERR_OR_ZERO(devm_create_dev_dax(&data)); } static struct platform_driver dax_hmem_driver = { |