summaryrefslogtreecommitdiff
path: root/include/blk.h
diff options
context:
space:
mode:
authorTien Fong Chee <tien.fong.chee@intel.com>2018-07-06 16:26:36 +0800
committerTom Rini <trini@konsulko.com>2018-09-28 20:22:33 -0400
commitbc53d2637e5477ca3cd63ab942ef6038615a8e01 (patch)
tree5aea0b1ec694e13cb95477adaa59d83cb463f468 /include/blk.h
parent14dfc6482a9057472ea202d2df4133a45bc3c1bc (diff)
block: Add a function to find block device descriptor
Add a function to find the block device descriptor of the parent device. Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com> [trini: Move function declaration to avoid warning] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/blk.h')
-rw-r--r--include/blk.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/blk.h b/include/blk.h
index 86f6d5057f..6af219681c 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -406,6 +406,15 @@ int blk_select_hwpart(struct udevice *dev, int hwpart);
*/
int blk_get_from_parent(struct udevice *parent, struct udevice **devp);
+/**
+ * blk_get_by_device() - Get the block device descriptor for the given device
+ * @dev: Instance of a storage device
+ *
+ * Return: With block device descriptor on success , NULL if there is no such
+ * block device.
+ */
+struct blk_desc *blk_get_by_device(struct udevice *dev);
+
#else
#include <errno.h>
/*