2020-06-18 16:50:09

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v1 1/6] mips: Return proper error code from console ->setup() hook

For unifying console ->setup() handling, which is pure documented,
return error code, rather than non-zero arbitrary number.

Signed-off-by: Andy Shevchenko <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
---
arch/mips/fw/arc/arc_con.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/mips/fw/arc/arc_con.c b/arch/mips/fw/arc/arc_con.c
index 365e3913231e..7fdce236b298 100644
--- a/arch/mips/fw/arc/arc_con.c
+++ b/arch/mips/fw/arc/arc_con.c
@@ -28,7 +28,9 @@ static void prom_console_write(struct console *co, const char *s,

static int prom_console_setup(struct console *co, char *options)
{
- return !(prom_flags & PROM_FLAG_USE_AS_CONSOLE);
+ if (prom_flags & PROM_FLAG_USE_AS_CONSOLE)
+ return 0;
+ return -ENODEV;
}

static struct console arc_cons = {
--
2.27.0


2020-06-19 09:44:13

by Thomas Bogendoerfer

[permalink] [raw]
Subject: Re: [PATCH v1 1/6] mips: Return proper error code from console ->setup() hook

On Thu, Jun 18, 2020 at 07:47:46PM +0300, Andy Shevchenko wrote:
> For unifying console ->setup() handling, which is pure documented,
> return error code, rather than non-zero arbitrary number.
>
> Signed-off-by: Andy Shevchenko <[email protected]>
> Cc: Thomas Bogendoerfer <[email protected]>
> ---
> arch/mips/fw/arc/arc_con.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

Acked-by: Thomas Bogendoerfer <[email protected]>

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]

2020-06-22 14:30:00

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH v1 1/6] mips: Return proper error code from console ->setup() hook

On 18. 06. 20, 18:47, Andy Shevchenko wrote:
> For unifying console ->setup() handling, which is pure documented,

Did you mean s/pure/poorly/ in all the patches? Or purely? But then where?

> return error code, rather than non-zero arbitrary number.
>
> Signed-off-by: Andy Shevchenko <[email protected]>
> Cc: Thomas Bogendoerfer <[email protected]>

thanks,
--
js
suse labs

2020-06-22 14:40:56

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v1 1/6] mips: Return proper error code from console ->setup() hook

On Mon, Jun 22, 2020 at 5:30 PM Jiri Slaby <[email protected]> wrote:
>
> On 18. 06. 20, 18:47, Andy Shevchenko wrote:
> > For unifying console ->setup() handling, which is pure documented,
>
> Did you mean s/pure/poorly/ in all the patches? Or purely? But then where?

Poorly.

--
With Best Regards,
Andy Shevchenko