Commit d55174cc authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Dan Williams

nvdimm/pmem: fix creating the dax group

The recent block layer refactoring broke the way how the pmem driver
abused device_add_disk.  Fix this by properly passing the attribute groups
to device_add_disk.

Fixes: 52b85909 ("block: fold register_disk into device_add_disk")
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
Reviewed-by: default avatarDan Williams <dan.j.williams@intel.com>
Tested-by: default avatarDarrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20210922173431.2454024-2-hch@lst.deSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent f060db99
...@@ -380,7 +380,6 @@ static int pmem_attach_disk(struct device *dev, ...@@ -380,7 +380,6 @@ static int pmem_attach_disk(struct device *dev,
struct nd_pfn_sb *pfn_sb; struct nd_pfn_sb *pfn_sb;
struct pmem_device *pmem; struct pmem_device *pmem;
struct request_queue *q; struct request_queue *q;
struct device *gendev;
struct gendisk *disk; struct gendisk *disk;
void *addr; void *addr;
int rc; int rc;
...@@ -489,10 +488,8 @@ static int pmem_attach_disk(struct device *dev, ...@@ -489,10 +488,8 @@ static int pmem_attach_disk(struct device *dev,
} }
dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); dax_write_cache(dax_dev, nvdimm_has_cache(nd_region));
pmem->dax_dev = dax_dev; pmem->dax_dev = dax_dev;
gendev = disk_to_dev(disk);
gendev->groups = pmem_attribute_groups;
device_add_disk(dev, disk, NULL); device_add_disk(dev, disk, pmem_attribute_groups);
if (devm_add_action_or_reset(dev, pmem_release_disk, pmem)) if (devm_add_action_or_reset(dev, pmem_release_disk, pmem))
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment