diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-07-09 19:46:29 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-07-11 19:13:41 -0400 |
commit | a8f720224eff09ea684b7f74aa1c0dff3da03170 (patch) | |
tree | 3914536575ff797fc49c28406e4fce684eff4907 /drivers/nvdimm | |
parent | 85d3fa02e4f8b4f59b9ae3f6f7d8312a1dcf28c8 (diff) |
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>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r-- | drivers/nvdimm/region.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvdimm/region.c b/drivers/nvdimm/region.c index 333175dac8d5..8f241772ec0b 100644 --- a/drivers/nvdimm/region.c +++ b/drivers/nvdimm/region.c | |||
@@ -82,6 +82,8 @@ static int nd_region_remove(struct device *dev) | |||
82 | { | 82 | { |
83 | struct nd_region *nd_region = to_nd_region(dev); | 83 | struct nd_region *nd_region = to_nd_region(dev); |
84 | 84 | ||
85 | device_for_each_child(dev, NULL, child_unregister); | ||
86 | |||
85 | /* flush attribute readers and disable */ | 87 | /* flush attribute readers and disable */ |
86 | nvdimm_bus_lock(dev); | 88 | nvdimm_bus_lock(dev); |
87 | nd_region->ns_seed = NULL; | 89 | nd_region->ns_seed = NULL; |
@@ -91,7 +93,6 @@ static int nd_region_remove(struct device *dev) | |||
91 | dev_set_drvdata(dev, NULL); | 93 | dev_set_drvdata(dev, NULL); |
92 | nvdimm_bus_unlock(dev); | 94 | nvdimm_bus_unlock(dev); |
93 | 95 | ||
94 | device_for_each_child(dev, NULL, child_unregister); | ||
95 | return 0; | 96 | return 0; |
96 | } | 97 | } |
97 | 98 | ||