Commit 93694f96 authored by Dan Williams's avatar Dan Williams

device-dax: Kill dax_region base

Nothing consumes this attribute of a region and devres otherwise
remembers the value for de-allocation purposes.
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 21b9e979
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
/** /**
* struct dax_region - mapping infrastructure for dax devices * struct dax_region - mapping infrastructure for dax devices
* @id: kernel-wide unique region for a memory range * @id: kernel-wide unique region for a memory range
* @base: linear address corresponding to @res
* @kref: to pin while other agents have a need to do lookups * @kref: to pin while other agents have a need to do lookups
* @dev: parent device backing this region * @dev: parent device backing this region
* @align: allocation and mapping alignment for child dax devices * @align: allocation and mapping alignment for child dax devices
...@@ -28,7 +27,6 @@ ...@@ -28,7 +27,6 @@
*/ */
struct dax_region { struct dax_region {
int id; int id;
void *base;
struct kref kref; struct kref kref;
struct device *dev; struct device *dev;
unsigned int align; unsigned int align;
......
...@@ -17,9 +17,8 @@ struct dev_dax; ...@@ -17,9 +17,8 @@ struct dev_dax;
struct resource; struct resource;
struct dax_region; struct dax_region;
void dax_region_put(struct dax_region *dax_region); void dax_region_put(struct dax_region *dax_region);
struct dax_region *alloc_dax_region(struct device *parent, struct dax_region *alloc_dax_region(struct device *parent, int region_id,
int region_id, struct resource *res, unsigned int align, struct resource *res, unsigned int align, unsigned long flags);
void *addr, unsigned long flags);
struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region, struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region,
int id, struct resource *res, int count); int id, struct resource *res, int count);
#endif /* __DEVICE_DAX_H__ */ #endif /* __DEVICE_DAX_H__ */
...@@ -100,7 +100,7 @@ static void dax_region_unregister(void *region) ...@@ -100,7 +100,7 @@ static void dax_region_unregister(void *region)
} }
struct dax_region *alloc_dax_region(struct device *parent, int region_id, struct dax_region *alloc_dax_region(struct device *parent, int region_id,
struct resource *res, unsigned int align, void *addr, struct resource *res, unsigned int align,
unsigned long pfn_flags) unsigned long pfn_flags)
{ {
struct dax_region *dax_region; struct dax_region *dax_region;
...@@ -130,7 +130,6 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id, ...@@ -130,7 +130,6 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
dax_region->id = region_id; dax_region->id = region_id;
dax_region->align = align; dax_region->align = align;
dax_region->dev = parent; dax_region->dev = parent;
dax_region->base = addr;
if (sysfs_create_groups(&parent->kobj, dax_region_attribute_groups)) { if (sysfs_create_groups(&parent->kobj, dax_region_attribute_groups)) {
kfree(dax_region); kfree(dax_region);
return NULL; return NULL;
......
...@@ -125,7 +125,7 @@ static int dax_pmem_probe(struct device *dev) ...@@ -125,7 +125,7 @@ static int dax_pmem_probe(struct device *dev)
return -EINVAL; return -EINVAL;
dax_region = alloc_dax_region(dev, region_id, &res, dax_region = alloc_dax_region(dev, region_id, &res,
le32_to_cpu(pfn_sb->align), addr, PFN_DEV|PFN_MAP); le32_to_cpu(pfn_sb->align), PFN_DEV|PFN_MAP);
if (!dax_region) if (!dax_region)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment