[PATCH 2/3] state: driver: handle EPROBE_DEFER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When state_new_from_node() returns -ENODEV that means that there
is no device available for the node, so return -EPROBE_DEFER in this
case and hope a device is there later.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/misc/state.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/state.c b/drivers/misc/state.c
index b9eb1b7..b43aee6 100644
--- a/drivers/misc/state.c
+++ b/drivers/misc/state.c
@@ -28,8 +28,12 @@ static int state_probe(struct device_d *dev)
 	bool readonly = false;
 
 	state = state_new_from_node(np, NULL, 0, 0, readonly);
-	if (IS_ERR(state))
-		return PTR_ERR(state);
+	if (IS_ERR(state)) {
+		int ret = PTR_ERR(state);
+		if (ret == -ENODEV)
+			ret = -EPROBE_DEFER;
+		return ret;
+	}
 
 	return 0;
 }
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux