diff options
author | NeilBrown <neilb@suse.com> | 2016-03-09 16:59:28 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-03-09 18:00:24 -0500 |
commit | ff8e92d5d94b99aab39f439d532cba435947dfc0 (patch) | |
tree | b06ec5048a57e07f4a4287fa199947056c27b2bf | |
parent | ec56151d382c2140851b4f25203af9016ba84fea (diff) |
nvdimm/btt: don't allocate unused major device number
alloc_disk(0) does not require or use a ->major number,
all devices are allocated with a major of BLOCK_EXT_MAJOR.
So don't allocate btt_major.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/nvdimm/btt.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index efb2c1ceef98..c32cbb593600 100644 --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c | |||
@@ -31,8 +31,6 @@ enum log_ent_request { | |||
31 | LOG_OLD_ENT | 31 | LOG_OLD_ENT |
32 | }; | 32 | }; |
33 | 33 | ||
34 | static int btt_major; | ||
35 | |||
36 | static int arena_read_bytes(struct arena_info *arena, resource_size_t offset, | 34 | static int arena_read_bytes(struct arena_info *arena, resource_size_t offset, |
37 | void *buf, size_t n) | 35 | void *buf, size_t n) |
38 | { | 36 | { |
@@ -1246,7 +1244,6 @@ static int btt_blk_init(struct btt *btt) | |||
1246 | 1244 | ||
1247 | nvdimm_namespace_disk_name(ndns, btt->btt_disk->disk_name); | 1245 | nvdimm_namespace_disk_name(ndns, btt->btt_disk->disk_name); |
1248 | btt->btt_disk->driverfs_dev = &btt->nd_btt->dev; | 1246 | btt->btt_disk->driverfs_dev = &btt->nd_btt->dev; |
1249 | btt->btt_disk->major = btt_major; | ||
1250 | btt->btt_disk->first_minor = 0; | 1247 | btt->btt_disk->first_minor = 0; |
1251 | btt->btt_disk->fops = &btt_fops; | 1248 | btt->btt_disk->fops = &btt_fops; |
1252 | btt->btt_disk->private_data = btt; | 1249 | btt->btt_disk->private_data = btt; |
@@ -1423,22 +1420,11 @@ EXPORT_SYMBOL(nvdimm_namespace_detach_btt); | |||
1423 | 1420 | ||
1424 | static int __init nd_btt_init(void) | 1421 | static int __init nd_btt_init(void) |
1425 | { | 1422 | { |
1426 | int rc; | 1423 | int rc = 0; |
1427 | |||
1428 | btt_major = register_blkdev(0, "btt"); | ||
1429 | if (btt_major < 0) | ||
1430 | return btt_major; | ||
1431 | 1424 | ||
1432 | debugfs_root = debugfs_create_dir("btt", NULL); | 1425 | debugfs_root = debugfs_create_dir("btt", NULL); |
1433 | if (IS_ERR_OR_NULL(debugfs_root)) { | 1426 | if (IS_ERR_OR_NULL(debugfs_root)) |
1434 | rc = -ENXIO; | 1427 | rc = -ENXIO; |
1435 | goto err_debugfs; | ||
1436 | } | ||
1437 | |||
1438 | return 0; | ||
1439 | |||
1440 | err_debugfs: | ||
1441 | unregister_blkdev(btt_major, "btt"); | ||
1442 | 1428 | ||
1443 | return rc; | 1429 | return rc; |
1444 | } | 1430 | } |
@@ -1446,7 +1432,6 @@ static int __init nd_btt_init(void) | |||
1446 | static void __exit nd_btt_exit(void) | 1432 | static void __exit nd_btt_exit(void) |
1447 | { | 1433 | { |
1448 | debugfs_remove_recursive(debugfs_root); | 1434 | debugfs_remove_recursive(debugfs_root); |
1449 | unregister_blkdev(btt_major, "btt"); | ||
1450 | } | 1435 | } |
1451 | 1436 | ||
1452 | MODULE_ALIAS_ND_DEVICE(ND_DEVICE_BTT); | 1437 | MODULE_ALIAS_ND_DEVICE(ND_DEVICE_BTT); |