From: Brian Norris Date: Wed, 3 Sep 2014 18:06:43 +0000 (-0700) Subject: of: correct of_console_check()'s return value X-Git-Tag: v3.17-rc7~14^2~5 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=5f74d8b7b8546255db6af45b017e9cbb18aed609;p=linux.git 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: 3482f2c52b77 ('of: Create of_console_check() for selecting a console specified in /chosen') Signed-off-by: Brian Norris Signed-off-by: Grant Likely --- diff --git a/drivers/of/base.c b/drivers/of/base.c index d8574adf0d62..bcfd08c2795c 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -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);