From 19b241c61faaa18c777e684ca5c43ad461af0afd Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Fri, 10 Dec 2021 15:49:29 +0900 Subject: blk: add a helper function, blk_probe_or_unbind() This function will be commonly used in block device drivers in the succeeding patches. Signed-off-by: AKASHI Takahiro Reviewed-by: Simon Glass Reviewed-by: Heinrich Schuchardt --- include/blk.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/blk.h') diff --git a/include/blk.h b/include/blk.h index dde2173257..133204a82e 100644 --- a/include/blk.h +++ b/include/blk.h @@ -370,6 +370,18 @@ int blk_create_devicef(struct udevice *parent, const char *drv_name, const char *name, int if_type, int devnum, int blksz, lbaint_t lba, struct udevice **devp); +/** + * blk_probe_or_unbind() - Try to probe + * + * Try to probe the device, primarily for enumerating partitions. + * If it fails, the device itself is unbound since it means that it won't + * work any more. + * + * @dev: The device to probe + * Return: 0 if OK, -ve on error + */ +int blk_probe_or_unbind(struct udevice *dev); + /** * blk_unbind_all() - Unbind all device of the given interface type * -- cgit v1.2.3