Skip to content

Commit

Permalink
of: correct of_console_check()'s return value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brian Norris authored and Grant Likely committed Sep 8, 2014
1 parent 2ce7598 commit 5f74d8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ bool of_console_check(struct device_node *dn, char *name, int index)
{
if (!dn || dn != of_stdout || console_set_on_cmdline)
return false;
return add_preferred_console(name, index, NULL);
return !add_preferred_console(name, index, NULL);
}
EXPORT_SYMBOL_GPL(of_console_check);

Expand Down

0 comments on commit 5f74d8b

Please sign in to comment.