vbe: Create a common function to get the block device

Add a vbe_get_blk() function and use it to obtain the block device used
by VBE.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/boot/vbe_common.h b/boot/vbe_common.h
index 1fc70ee..0cd9617 100644
--- a/boot/vbe_common.h
+++ b/boot/vbe_common.h
@@ -48,4 +48,17 @@
 	u8 spare2[0x34];
 };
 
+/**
+ * vbe_get_blk() - Obtain the block device to use for VBE
+ *
+ * Decodes the string to produce a block device
+ *
+ * @storage: String indicating the device to use, e.g. "mmc1"
+ * @blkp: Returns associated block device, on success
+ * Return 0 if OK, -ENODEV if @storage does not end with a number, -E2BIG if
+ * the device name is more than 15 characters, -ENXIO if the block device could
+ * not be found
+ */
+int vbe_get_blk(const char *storage, struct udevice **blkp);
+
 #endif /* __VBE_ABREC_H */