libnvdimm: keep region data alive over namespace removal
nd_region device driver data will be used in the namespace i/o path. Re-order nd_region_remove() to ensure this data stays live across namespace device removal Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
85d3fa02e4
commit
a8f720224e
|
@ -82,6 +82,8 @@ static int nd_region_remove(struct device *dev)
|
||||||
{
|
{
|
||||||
struct nd_region *nd_region = to_nd_region(dev);
|
struct nd_region *nd_region = to_nd_region(dev);
|
||||||
|
|
||||||
|
device_for_each_child(dev, NULL, child_unregister);
|
||||||
|
|
||||||
/* flush attribute readers and disable */
|
/* flush attribute readers and disable */
|
||||||
nvdimm_bus_lock(dev);
|
nvdimm_bus_lock(dev);
|
||||||
nd_region->ns_seed = NULL;
|
nd_region->ns_seed = NULL;
|
||||||
|
@ -91,7 +93,6 @@ static int nd_region_remove(struct device *dev)
|
||||||
dev_set_drvdata(dev, NULL);
|
dev_set_drvdata(dev, NULL);
|
||||||
nvdimm_bus_unlock(dev);
|
nvdimm_bus_unlock(dev);
|
||||||
|
|
||||||
device_for_each_child(dev, NULL, child_unregister);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue