From: Dan Williams Date: Sat, 9 Jul 2016 23:46:29 +0000 (-0700) Subject: libnvdimm: keep region data alive over namespace removal X-Git-Tag: v4.8-rc1~114^2^2~23 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a8f720224eff09ea684b7f74aa1c0dff3da03170;p=karo-tx-linux.git 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 --- 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) { struct nd_region *nd_region = to_nd_region(dev); + device_for_each_child(dev, NULL, child_unregister); + /* flush attribute readers and disable */ nvdimm_bus_lock(dev); nd_region->ns_seed = NULL; @@ -91,7 +93,6 @@ static int nd_region_remove(struct device *dev) dev_set_drvdata(dev, NULL); nvdimm_bus_unlock(dev); - device_for_each_child(dev, NULL, child_unregister); return 0; }