Skip to content

Commit 5f74d8b

Browse files
computersforpeaceglikely
authored andcommitted
of: correct of_console_check()'s return value
The comments above of_console_check() say that it will return TRUE if it registers a preferred console, but add_preferred_console() uses a 0-equals-success convention, so this leaves of_console_check() with an inconsistent policy for its return values. Fortunately, nobody was actually checking the return value of of_console_check(), so this isn't significant at the moment. But let's match the comments, so we're doing what we say. Fixes: 3482f2c ('of: Create of_console_check() for selecting a console specified in /chosen') Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
1 parent 2ce7598 commit 5f74d8b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/of/base.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ bool of_console_check(struct device_node *dn, char *name, int index)
19861986
{
19871987
if (!dn || dn != of_stdout || console_set_on_cmdline)
19881988
return false;
1989-
return add_preferred_console(name, index, NULL);
1989+
return !add_preferred_console(name, index, NULL);
19901990
}
19911991
EXPORT_SYMBOL_GPL(of_console_check);
19921992

0 commit comments

Comments
 (0)