From 9f103b9cb5f8de4f196b5ef8f6ddb4749cd732ba Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 27 May 2017 11:37:17 -0600 Subject: dm: blk: Add a way to obtain a block device from its parent Many devices support a child block device (e.g. MMC, USB). Add a convenient way to get this device given the parent device. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- include/blk.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/blk.h') diff --git a/include/blk.h b/include/blk.h index a128ee4841..4d60987f61 100644 --- a/include/blk.h +++ b/include/blk.h @@ -616,4 +616,11 @@ ulong blk_write_devnum(enum if_type if_type, int devnum, lbaint_t start, */ int blk_select_hwpart_devnum(enum if_type if_type, int devnum, int hwpart); +/** + * blk_get_from_parent() - obtain a block device by looking up its parent + * + * All devices with + */ +int blk_get_from_parent(struct udevice *parent, struct udevice **devp); + #endif -- cgit