summaryrefslogtreecommitdiff
path: root/include/blk.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-04-24 02:02:05 (GMT)
committerSimon Glass <sjg@chromium.org>2017-06-01 13:03:04 (GMT)
commit6139281a6473334351c8776643478c0b0e208342 (patch)
tree501de9018b4716ecc19bfcff404b4ea10f65e0ee /include/blk.h
parente7017a3c7d2f9ff845516675205c99df4ad6eacc (diff)
downloadu-boot-6139281a6473334351c8776643478c0b0e208342.tar.xz
dm: blk: Allow finding block devices without probing
Sometimes it is useful to be able to find a block device without also probing it. Add a function for this as well as the associated test. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/blk.h')
-rw-r--r--include/blk.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/blk.h b/include/blk.h
index 66a1c55..a128ee4 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -253,12 +253,25 @@ unsigned long blk_derase(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt);
/**
+ * blk_find_device() - Find a block device
+ *
+ * This function does not activate the device. The device will be returned
+ * whether or not it is activated.
+ *
+ * @if_type: Interface type (enum if_type_t)
+ * @devnum: Device number (specific to each interface type)
+ * @devp: the device, if found
+ * @return 0 if found, -ENODEV if no device found, or other -ve error value
+ */
+int blk_find_device(int if_type, int devnum, struct udevice **devp);
+
+/**
* blk_get_device() - Find and probe a block device ready for use
*
* @if_type: Interface type (enum if_type_t)
* @devnum: Device number (specific to each interface type)
* @devp: the device, if found
- * @return - if found, -ENODEV if no device found, or other -ve error value
+ * @return 0 if found, -ENODEV if no device found, or other -ve error value
*/
int blk_get_device(int if_type, int devnum, struct udevice **devp);