summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/region.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-02-18 10:29:49 -0800
committerDan Williams <dan.j.williams@intel.com>2016-03-05 12:24:06 -0800
commit719994660c249a086a7493205c7f1562e30c38cb (patch)
treec45b589901ab8e779e8b6b423c63ba45475991fc /drivers/nvdimm/region.c
parent5faecf4eb0d7d67e809a4bc9059c764c27670832 (diff)
downloadlinux-719994660c249a086a7493205c7f1562e30c38cb.tar.gz
linux-719994660c249a086a7493205c7f1562e30c38cb.tar.bz2
linux-719994660c249a086a7493205c7f1562e30c38cb.zip
libnvdimm: async notification support
In preparation for asynchronous address range scrub support add an ability for the pmem driver to dynamically consume address range scrub results. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/region.c')
-rw-r--r--drivers/nvdimm/region.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/nvdimm/region.c b/drivers/nvdimm/region.c
index 7da63eac78ee..4b7715e29cff 100644
--- a/drivers/nvdimm/region.c
+++ b/drivers/nvdimm/region.c
@@ -93,9 +93,21 @@ static int nd_region_remove(struct device *dev)
return 0;
}
+static int child_notify(struct device *dev, void *data)
+{
+ nd_device_notify(dev, *(enum nvdimm_event *) data);
+ return 0;
+}
+
+static void nd_region_notify(struct device *dev, enum nvdimm_event event)
+{
+ device_for_each_child(dev, &event, child_notify);
+}
+
static struct nd_device_driver nd_region_driver = {
.probe = nd_region_probe,
.remove = nd_region_remove,
+ .notify = nd_region_notify,
.drv = {
.name = "nd_region",
},