summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-10-20 09:27:41 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-10-20 09:31:11 +0200
commit70af08d8634c00e9593a4407b86a303246791cfb (patch)
treec9232411ae7ea8a2789d3707f3c647e19fd36902 /drivers/misc
parent8099956f6a99fbedc9a81ef5e3f480b9bc4e9424 (diff)
downloadbarebox-70af08d8634c00e9593a4407b86a303246791cfb.tar.gz
barebox-70af08d8634c00e9593a4407b86a303246791cfb.tar.xz
state: driver: handle EPROBE_DEFER
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@pengutronix.de>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/state.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/misc/state.c b/drivers/misc/state.c
index b9eb1b7bb2..b43aee60fe 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;
}