* [PATCH] of: unittest: fix an error code in of_unittest_apply_overlay()
@ 2018-03-14 20:08 Dan Carpenter
2018-03-18 12:52 ` Rob Herring
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-03-14 20:08 UTC (permalink / raw)
To: Rob Herring, Frank Rowand; +Cc: devicetree, linux-kernel, kernel-janitors
We accidentally return zero on failure instead of a negative error code.
Fixes: 39a751a4cb7e ("of: change overlay apply input data from unflattened to FDT")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index dede77a79820..bc03902693b7 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -1417,15 +1417,13 @@ static int __init of_unittest_apply_overlay(int overlay_nr, int unittest_nr,
int *overlay_id)
{
const char *overlay_name;
- int ret;
overlay_name = overlay_name_from_nr(overlay_nr);
- ret = overlay_data_apply(overlay_name, overlay_id);
- if (!ret) {
+ if (!overlay_data_apply(overlay_name, overlay_id)) {
unittest(0, "could not apply overlay \"%s\"\n",
overlay_name);
- return ret;
+ return -EFAULT;
}
of_unittest_track_overlay(*overlay_id);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-18 12:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-14 20:08 [PATCH] of: unittest: fix an error code in of_unittest_apply_overlay() Dan Carpenter
2018-03-18 12:52 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox