diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-02-18 21:29:49 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-03-05 23:24:06 +0300 |
commit | 719994660c249a086a7493205c7f1562e30c38cb (patch) | |
tree | c45b589901ab8e779e8b6b423c63ba45475991fc /drivers/nvdimm/region.c | |
parent | 5faecf4eb0d7d67e809a4bc9059c764c27670832 (diff) | |
download | linux-719994660c249a086a7493205c7f1562e30c38cb.tar.xz |
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.c | 12 |
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", }, |