summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-10-10 08:11:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-10-11 16:46:25 +0200
commit15111afb387482035fc64ca5b621ec6c933ac7f8 (patch)
tree94d36b8ba6cb5adb24b92766b3f87352bc78d000 /include
parent104ba12a92f3c4c31ffd203ff9667063381c43cb (diff)
downloadbarebox-15111afb387482035fc64ca5b621ec6c933ac7f8.tar.gz
barebox-15111afb387482035fc64ca5b621ec6c933ac7f8.tar.xz
block: have cdev_get_block_device accept const cdev
Having a non-const cdev parameter for cdev_get_block_device() limits its use as a user may want to just read struct block_device members without change. Allow this by changing parameter to be pointer to const instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/block.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/block.h b/include/block.h
index 1fb40e942f..8740a03d36 100644
--- a/include/block.h
+++ b/include/block.h
@@ -50,9 +50,9 @@ static inline int block_flush(struct block_device *blk)
}
#ifdef CONFIG_BLOCK
-struct block_device *cdev_get_block_device(struct cdev *cdev);
+struct block_device *cdev_get_block_device(const struct cdev *cdev);
#else
-static inline struct block_device *cdev_get_block_device(struct cdev *cdev)
+static inline struct block_device *cdev_get_block_device(const struct cdev *cdev)
{
return NULL;
}