summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-14 19:19:57 +0100
committerJens Axboe <axboe@kernel.dk>2020-12-01 14:53:39 -0700
commitc2637e80a09e0d6c698d2771d7230f59c2138122 (patch)
tree249ad0cdb743770a5d6f87badffec4c0649b3872 /include
parent3a4174e68684e43ecdcb59126a441b29d5e94f7f (diff)
init: refactor name_to_dev_t
Split each case into a self-contained helper, and move the block dependent code entirely under the pre-existing #ifdef CONFIG_BLOCK. This allows to remove the blk_lookup_devt stub in genhd.h. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/genhd.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 22f5b9fd96f8..ca5e356084c3 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -388,18 +388,13 @@ static inline void bd_unlink_disk_holder(struct block_device *bdev,
}
#endif /* CONFIG_SYSFS */
+dev_t blk_lookup_devt(const char *name, int partno);
#ifdef CONFIG_BLOCK
void printk_all_partitions(void);
-dev_t blk_lookup_devt(const char *name, int partno);
#else /* CONFIG_BLOCK */
static inline void printk_all_partitions(void)
{
}
-static inline dev_t blk_lookup_devt(const char *name, int partno)
-{
- dev_t devt = MKDEV(0, 0);
- return devt;
-}
#endif /* CONFIG_BLOCK */
#endif /* _LINUX_GENHD_H */