libnvdimm: use devm_add_action_or_reset()
authorDan Williams <dan.j.williams@intel.com>
Wed, 15 Jun 2016 21:59:17 +0000 (14:59 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 15 Jun 2016 21:59:17 +0000 (14:59 -0700)
commitf02716db951c5e01acf48df9fe815007674fecff
tree011a5c22e8ff2c8fa10379c1a7ec84e1f54aae3e
parent5edb56491d4812c42175980759da53388e5d86f5
libnvdimm: use devm_add_action_or_reset()

Clean up needless calls to the action routine by letting
devm_add_action_or_reset() call it automatically.  This does cause the
disk to registered and immediately unregistered when a memory allocation
fails, but the block layer should be prepared for such an event.

Reported-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/blk.c
drivers/nvdimm/pmem.c