Skip to content

Commit d55174c

Browse files
Christoph Hellwigdjbw
authored andcommitted
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: 52b8590 ("block: fold register_disk into device_add_disk") Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Reviewed-by: Dan Williams <[email protected]> Tested-by: Darrick J. Wong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent f060db9 commit d55174c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/nvdimm/pmem.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ static int pmem_attach_disk(struct device *dev,
380380
struct nd_pfn_sb *pfn_sb;
381381
struct pmem_device *pmem;
382382
struct request_queue *q;
383-
struct device *gendev;
384383
struct gendisk *disk;
385384
void *addr;
386385
int rc;
@@ -489,10 +488,8 @@ static int pmem_attach_disk(struct device *dev,
489488
}
490489
dax_write_cache(dax_dev, nvdimm_has_cache(nd_region));
491490
pmem->dax_dev = dax_dev;
492-
gendev = disk_to_dev(disk);
493-
gendev->groups = pmem_attribute_groups;
494491

495-
device_add_disk(dev, disk, NULL);
492+
device_add_disk(dev, disk, pmem_attribute_groups);
496493
if (devm_add_action_or_reset(dev, pmem_release_disk, pmem))
497494
return -ENOMEM;
498495

0 commit comments

Comments
 (0)