diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-03-14 23:08:28 +0300 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2018-03-19 22:52:40 -0500 |
commit | 827473268ee492b30b576ef156ab524a2b9f3520 (patch) | |
tree | 4798ef8eb4e41b684488333fb3f7dfc1df37f96f /drivers/of | |
parent | 202fbf4865e97b64ca2d94b7dc1a4efd6f7b0729 (diff) | |
download | linux-stable-827473268ee492b30b576ef156ab524a2b9f3520.tar.gz linux-stable-827473268ee492b30b576ef156ab524a2b9f3520.tar.bz2 linux-stable-827473268ee492b30b576ef156ab524a2b9f3520.zip |
of: unittest: fix an error code in of_unittest_apply_overlay()
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>
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/unittest.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index a08c9e2d5c4c..02c5984ab09b 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -1423,15 +1423,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); |