Lines Matching refs:dax_region
162 struct dax_region *dax_region = dev_get_drvdata(dev); in id_show() local
164 return sprintf(buf, "%d\n", dax_region->id); in id_show()
171 struct dax_region *dax_region = dev_get_drvdata(dev); in region_size_show() local
174 resource_size(&dax_region->res)); in region_size_show()
182 struct dax_region *dax_region = dev_get_drvdata(dev); in align_show() local
184 return sprintf(buf, "%u\n", dax_region->align); in align_show()
207 struct dax_region *dax_region; in dax_region_free() local
209 dax_region = container_of(kref, struct dax_region, kref); in dax_region_free()
210 kfree(dax_region); in dax_region_free()
213 void dax_region_put(struct dax_region *dax_region) in dax_region_put() argument
215 kref_put(&dax_region->kref, dax_region_free); in dax_region_put()
221 struct dax_region *dax_region = region; in dax_region_unregister() local
223 sysfs_remove_groups(&dax_region->dev->kobj, in dax_region_unregister()
225 dax_region_put(dax_region); in dax_region_unregister()
228 struct dax_region *alloc_dax_region(struct device *parent, int region_id, in alloc_dax_region()
232 struct dax_region *dax_region; in alloc_dax_region() local
248 dax_region = kzalloc(sizeof(*dax_region), GFP_KERNEL); in alloc_dax_region()
249 if (!dax_region) in alloc_dax_region()
252 dev_set_drvdata(parent, dax_region); in alloc_dax_region()
253 memcpy(&dax_region->res, res, sizeof(*res)); in alloc_dax_region()
254 dax_region->pfn_flags = pfn_flags; in alloc_dax_region()
255 kref_init(&dax_region->kref); in alloc_dax_region()
256 dax_region->id = region_id; in alloc_dax_region()
257 dax_region->align = align; in alloc_dax_region()
258 dax_region->dev = parent; in alloc_dax_region()
259 dax_region->target_node = target_node; in alloc_dax_region()
261 kfree(dax_region); in alloc_dax_region()
265 kref_get(&dax_region->kref); in alloc_dax_region()
266 if (devm_add_action_or_reset(parent, dax_region_unregister, dax_region)) in alloc_dax_region()
268 return dax_region; in alloc_dax_region()
284 struct dax_region *dax_region = dev_dax->region; in dev_dax_target_node() local
286 return dax_region->target_node; in dev_dax_target_node()
300 struct dax_region *dax_region = dev_dax->region; in dev_dax_resource() local
302 return dax_region->res.start; in dev_dax_resource()
368 struct dax_region *dax_region = dev_dax->region; in dev_dax_release() local
371 dax_region_put(dax_region); in dev_dax_release()
387 struct dev_dax *__devm_create_dev_dax(struct dax_region *dax_region, int id, in __devm_create_dev_dax() argument
390 struct device *parent = dax_region->dev; in __devm_create_dev_dax()
422 dev_dax->region = dax_region; in __devm_create_dev_dax()
423 dev_dax->target_node = dax_region->target_node; in __devm_create_dev_dax()
424 kref_get(&dax_region->kref); in __devm_create_dev_dax()
435 dev_set_name(dev, "dax%d.%d", dax_region->id, id); in __devm_create_dev_dax()
444 rc = devm_add_action_or_reset(dax_region->dev, unregister_dev_dax, dev); in __devm_create_dev_dax()