nvdimm/pmem: use add_disk() error handling
authorLuis Chamberlain <mcgrof@kernel.org>
Wed, 3 Nov 2021 23:04:29 +0000 (16:04 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 4 Nov 2021 11:48:50 +0000 (05:48 -0600)
commit5a192ccc32e2981f721343c750b8cfb4c3f41007
treee1fbde99aea2d1af47f1dd33368625dd5890a34e
parentaccf58afb689f81daadde24080ea1164ad2db75f
nvdimm/pmem: use add_disk() error handling

Now that device_add_disk() supports returning an error, use
that. We must unwind alloc_dax() on error.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20211103230437.1639990-7-mcgrof@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvdimm/pmem.c