[PATCH 2/6] state: return -EPROBE_DEFER if the backend isn't available

Marc Kleine-Budde mkl at pengutronix.de
Mon Oct 19 03:23:36 PDT 2015


From: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
---
 drivers/misc/state.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/state.c b/drivers/misc/state.c
index 7a3303264206..f3096fc27098 100644
--- a/drivers/misc/state.c
+++ b/drivers/misc/state.c
@@ -52,6 +52,8 @@ static int state_probe(struct device_d *dev)
 	/* guess if of_path is a path, not a phandle */
 	if (of_path[0] == '/' && len > 1) {
 		ret = of_find_path(np, "backend", &path, 0);
+		if (ret == -ENODEV)
+			ret = -EPROBE_DEFER;
 		if (ret)
 			goto out_release;
 	} else {
@@ -66,7 +68,7 @@ static int state_probe(struct device_d *dev)
 
 		dev = of_find_device_by_node(partition_node);
 		if (!list_is_singular(&dev->cdevs)) {
-			ret = -ENODEV;
+			ret = -EPROBE_DEFER;
 			goto out_release;
 		}
 
-- 
2.6.1




More information about the barebox mailing list