]> git.sur5r.net Git - u-boot/blobdiff - include/blk.h
rockchip: dts: rk3399-puma: sync DTS with Linux tree
[u-boot] / include / blk.h
index 3fa373e208b932577e7eb6ca6b6851aff9998f9b..a128ee484145f306e1e994249626ef80ac915367 100644 (file)
@@ -63,6 +63,11 @@ struct blk_desc {
        char            product[20+1];  /* IDE Serial no, SCSI product */
        char            revision[8+1];  /* firmware revision */
 #ifdef CONFIG_BLK
+       /*
+        * For now we have a few functions which take struct blk_desc as a
+        * parameter. This field allows them to look up the associated
+        * device. Once these functions are removed we can drop this field.
+        */
        struct udevice *bdev;
 #else
        unsigned long   (*block_read)(struct blk_desc *block_dev,
@@ -247,13 +252,26 @@ unsigned long blk_dwrite(struct blk_desc *block_dev, lbaint_t start,
 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);