Skip to content
Snippets Groups Projects
Commit 1603bf3c authored by Simon Glass's avatar Simon Glass
Browse files

dm: sandbox: sf: Tidy up the error handling in sandbox_sf_probe()


Use a single exit point when we have an error and add debugging there.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent 081f2fcb
No related branches found
No related tags found
No related merge requests found
...@@ -141,8 +141,10 @@ static int sandbox_sf_probe(struct udevice *dev) ...@@ -141,8 +141,10 @@ static int sandbox_sf_probe(struct udevice *dev)
assert(bus->seq != -1); assert(bus->seq != -1);
if (bus->seq < CONFIG_SANDBOX_SPI_MAX_BUS) if (bus->seq < CONFIG_SANDBOX_SPI_MAX_BUS)
spec = state->spi[bus->seq][cs].spec; spec = state->spi[bus->seq][cs].spec;
if (!spec) if (!spec) {
return -ENOENT; ret = -ENOENT;
goto error;
}
file = strchr(spec, ':'); file = strchr(spec, ':');
if (!file) { if (!file) {
...@@ -196,6 +198,7 @@ static int sandbox_sf_probe(struct udevice *dev) ...@@ -196,6 +198,7 @@ static int sandbox_sf_probe(struct udevice *dev)
return 0; return 0;
error: error:
debug("%s: Got error %d\n", __func__, ret);
return ret; return ret;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment