* [PATCH] sparc: remove sunzilog_console_init
@ 2006-06-28 14:16 Martin Habets
2006-06-28 14:34 ` Martin Habets
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: Martin Habets @ 2006-06-28 14:16 UTC (permalink / raw)
To: sparclinux
Hi,
This patch against 2.6.17 resolves the following build warning:
CC drivers/serial/sunzilog.o
drivers/serial/sunzilog.c:1390: warning: `sunzilog_console_init' defined but not used
It was tested on a SS20 with the console on a sunzilog.
Martin
--- 2.6.17/drivers/serial/sunzilog.c.old 2006-06-28 15:04:17.000000000 +0100
+++ 2.6.17/drivers/serial/sunzilog.c 2006-06-28 15:07:43.000000000 +0100
@@ -1386,28 +1386,6 @@
.data = &sunzilog_reg,
};
-static int __init sunzilog_console_init(void)
-{
- int i;
-
- if (con_is_present())
- return 0;
-
- for (i = 0; i < NUM_CHANNELS; i++) {
- int this_minor = sunzilog_reg.minor + i;
-
- if ((this_minor - 64) = (serial_console - 1))
- break;
- }
- if (i = NUM_CHANNELS)
- return 0;
-
- sunzilog_console.index = i;
- sunzilog_port_table[i].flags |= SUNZILOG_FLAG_IS_CONS;
- register_console(&sunzilog_console);
- return 0;
-}
-
static inline struct console *SUNZILOG_CONSOLE(void)
{
int i;
@@ -1432,7 +1410,6 @@
#else
#define SUNZILOG_CONSOLE() (NULL)
-#define sunzilog_console_init() do { } while (0)
#endif
/*
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] sparc: remove sunzilog_console_init
2006-06-28 14:16 [PATCH] sparc: remove sunzilog_console_init Martin Habets
@ 2006-06-28 14:34 ` Martin Habets
2006-06-28 16:43 ` Raymond Burns
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Martin Habets @ 2006-06-28 14:34 UTC (permalink / raw)
To: sparclinux
Hi,
This patch against 2.6.17 resolves the following build warning:
CC drivers/serial/sunzilog.o
drivers/serial/sunzilog.c:1390: warning: `sunzilog_console_init' defined but not used
It was tested on a SS20 with the console on a sunzilog.
Martin
Signed-off-by: Martin Habets <errandir_news@mph.eclipse.co.uk>
---
--- 2.6.17/drivers/serial/sunzilog.c.old 2006-06-28 15:04:17.000000000 +0100
+++ 2.6.17/drivers/serial/sunzilog.c 2006-06-28 15:07:43.000000000 +0100
@@ -1386,28 +1386,6 @@
.data = &sunzilog_reg,
};
-static int __init sunzilog_console_init(void)
-{
- int i;
-
- if (con_is_present())
- return 0;
-
- for (i = 0; i < NUM_CHANNELS; i++) {
- int this_minor = sunzilog_reg.minor + i;
-
- if ((this_minor - 64) = (serial_console - 1))
- break;
- }
- if (i = NUM_CHANNELS)
- return 0;
-
- sunzilog_console.index = i;
- sunzilog_port_table[i].flags |= SUNZILOG_FLAG_IS_CONS;
- register_console(&sunzilog_console);
- return 0;
-}
-
static inline struct console *SUNZILOG_CONSOLE(void)
{
int i;
@@ -1432,7 +1410,6 @@
#else
#define SUNZILOG_CONSOLE() (NULL)
-#define sunzilog_console_init() do { } while (0)
#endif
/*
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] sparc: remove sunzilog_console_init
2006-06-28 14:16 [PATCH] sparc: remove sunzilog_console_init Martin Habets
2006-06-28 14:34 ` Martin Habets
@ 2006-06-28 16:43 ` Raymond Burns
2006-06-28 18:32 ` David Miller
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Raymond Burns @ 2006-06-28 16:43 UTC (permalink / raw)
To: sparclinux
Hi
Odd but I went the other direction, I added the line:
console_initcall(sunzilog_console_init);
near the bottom of the sunzilog.c file.
which removes the compiler warning but did not solve the trouble I
have where /dev/console cannot be opened:
Warning: unable to open an initial console.
Someone has went to length to rewrite a fair portion of the serial
code to attain compatability with generic handling of serial ports.
What direction is serial port code going now?
On Wed, 28 Jun 2006, Martin Habets wrote:
> Hi,
>
> This patch against 2.6.17 resolves the following build warning:
> CC drivers/serial/sunzilog.o
> drivers/serial/sunzilog.c:1390: warning: `sunzilog_console_init' defined but not used
>
> It was tested on a SS20 with the console on a sunzilog.
>
> Martin
>
> Signed-off-by: Martin Habets <errandir_news@mph.eclipse.co.uk>
> ---
> --- 2.6.17/drivers/serial/sunzilog.c.old 2006-06-28 15:04:17.000000000 +0100
> +++ 2.6.17/drivers/serial/sunzilog.c 2006-06-28 15:07:43.000000000 +0100
> @@ -1386,28 +1386,6 @@
> .data = &sunzilog_reg,
> };
>
> -static int __init sunzilog_console_init(void)
> -{
> - int i;
> -
> - if (con_is_present())
> - return 0;
> -
> - for (i = 0; i < NUM_CHANNELS; i++) {
> - int this_minor = sunzilog_reg.minor + i;
> -
> - if ((this_minor - 64) = (serial_console - 1))
> - break;
> - }
> - if (i = NUM_CHANNELS)
> - return 0;
> -
> - sunzilog_console.index = i;
> - sunzilog_port_table[i].flags |= SUNZILOG_FLAG_IS_CONS;
> - register_console(&sunzilog_console);
> - return 0;
> -}
> -
> static inline struct console *SUNZILOG_CONSOLE(void)
> {
> int i;
> @@ -1432,7 +1410,6 @@
>
> #else
> #define SUNZILOG_CONSOLE() (NULL)
> -#define sunzilog_console_init() do { } while (0)
> #endif
>
> /*
> -
> To unsubscribe from this list: send the line "unsubscribe sparclinux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Thanx
Ray
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] sparc: remove sunzilog_console_init
2006-06-28 14:16 [PATCH] sparc: remove sunzilog_console_init Martin Habets
2006-06-28 14:34 ` Martin Habets
2006-06-28 16:43 ` Raymond Burns
@ 2006-06-28 18:32 ` David Miller
2006-06-28 18:35 ` David Miller
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2006-06-28 18:32 UTC (permalink / raw)
To: sparclinux
From: Martin Habets <errandir_news@mph.eclipse.co.uk>
Date: Wed, 28 Jun 2006 15:16:01 +0100
> This patch against 2.6.17 resolves the following build warning:
> CC drivers/serial/sunzilog.o
> drivers/serial/sunzilog.c:1390: warning: `sunzilog_console_init' defined but not used
>
> It was tested on a SS20 with the console on a sunzilog.
I see that warning too, but there is no other code around to
register the console :-)
I did some transformations over the last year that somehow
made this function no longer invoked, when it should be,
and I need to figure that out and fix the problem properly.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] sparc: remove sunzilog_console_init
2006-06-28 14:16 [PATCH] sparc: remove sunzilog_console_init Martin Habets
` (2 preceding siblings ...)
2006-06-28 18:32 ` David Miller
@ 2006-06-28 18:35 ` David Miller
2006-06-29 17:02 ` Martin Habets
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2006-06-28 18:35 UTC (permalink / raw)
To: sparclinux
From: Martin Habets <errandir_news@mph.eclipse.co.uk>
Date: Wed, 28 Jun 2006 15:34:02 +0100
> It was tested on a SS20 with the console on a sunzilog.
Where does the register_console() call occur then?
Oh, it happens in the serial layer because we set
the ->cons member of sunzilog_reg right?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] sparc: remove sunzilog_console_init
2006-06-28 14:16 [PATCH] sparc: remove sunzilog_console_init Martin Habets
` (3 preceding siblings ...)
2006-06-28 18:35 ` David Miller
@ 2006-06-29 17:02 ` Martin Habets
2006-06-29 17:08 ` Martin Habets
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Martin Habets @ 2006-06-29 17:02 UTC (permalink / raw)
To: sparclinux
On Wed, Jun 28, 2006 at 11:35:41AM -0700, David Miller wrote:
> From: Martin Habets <errandir_news@mph.eclipse.co.uk>
> Date: Wed, 28 Jun 2006 15:34:02 +0100
>
> > It was tested on a SS20 with the console on a sunzilog.
>
> Where does the register_console() call occur then?
>
> Oh, it happens in the serial layer because we set
> the ->cons member of sunzilog_reg right?
Yes, sunzilog_ports_init calls uart_add_one_port, which calls
register_console (at serial_core.c:2270) with the new SUNZILOG_CONSOLE
function.
It's all more convoluted, but effectively SUNZILOG_CONSOLE has replaced
sunzilog_console_init.
>> I did some transformations over the last year that somehow
>> made this function no longer invoked, when it should be,
>> and I need to figure that out and fix the problem properly.
While it is possible to keep the function and call it like before
from sunzilog_ports_init, personally I don't see the point. Better
call SUNZILOG_CONSOLE if that's what you realy want.
--
Martin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] sparc: remove sunzilog_console_init
2006-06-28 14:16 [PATCH] sparc: remove sunzilog_console_init Martin Habets
` (4 preceding siblings ...)
2006-06-29 17:02 ` Martin Habets
@ 2006-06-29 17:08 ` Martin Habets
2006-06-29 19:53 ` David Miller
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Martin Habets @ 2006-06-29 17:08 UTC (permalink / raw)
To: sparclinux
On Wed, Jun 28, 2006 at 10:05:52AM -0700, Raymond Burns wrote:
> Hi
>
> Odd but I went the other direction, I added the line:
>
> console_initcall(sunzilog_console_init);
>
> near the bottom of the sunzilog.c file.
Yes, that would work too. Basically restoring part of the 2.6.16 code.
> which removes the compiler warning but did not solve the trouble I
> have where /dev/console cannot be opened:
>
> Warning: unable to open an initial console.
This is probably an different issue then. Best start a new thread
and post the console output, kernel version, if you're using udev
or devfs, 'ls -l /dev/console'.
> Someone has went to length to rewrite a fair portion of the serial
> code to attain compatability with generic handling of serial ports.
>
> What direction is serial port code going now?
I don't know what the intention behind it all is. I just do some local
fixing/optimizing where I see fit and can contribute.
--
Martin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] sparc: remove sunzilog_console_init
2006-06-28 14:16 [PATCH] sparc: remove sunzilog_console_init Martin Habets
` (5 preceding siblings ...)
2006-06-29 17:08 ` Martin Habets
@ 2006-06-29 19:53 ` David Miller
2006-06-29 19:54 ` David Miller
2006-06-29 22:19 ` Raymond Burns
8 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2006-06-29 19:53 UTC (permalink / raw)
To: sparclinux
From: Martin Habets <errandir_news@mph.eclipse.co.uk>
Date: Thu, 29 Jun 2006 18:02:09 +0100
> On Wed, Jun 28, 2006 at 11:35:41AM -0700, David Miller wrote:
> > From: Martin Habets <errandir_news@mph.eclipse.co.uk>
> > Date: Wed, 28 Jun 2006 15:34:02 +0100
> >
> > > It was tested on a SS20 with the console on a sunzilog.
> >
> > Where does the register_console() call occur then?
> >
> > Oh, it happens in the serial layer because we set
> > the ->cons member of sunzilog_reg right?
>
> Yes, sunzilog_ports_init calls uart_add_one_port, which calls
> register_console (at serial_core.c:2270) with the new SUNZILOG_CONSOLE
> function.
>
> It's all more convoluted, but effectively SUNZILOG_CONSOLE has replaced
> sunzilog_console_init.
Thanks, I've integrated your fix into my tree.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] sparc: remove sunzilog_console_init
2006-06-28 14:16 [PATCH] sparc: remove sunzilog_console_init Martin Habets
` (6 preceding siblings ...)
2006-06-29 19:53 ` David Miller
@ 2006-06-29 19:54 ` David Miller
2006-06-29 22:19 ` Raymond Burns
8 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2006-06-29 19:54 UTC (permalink / raw)
To: sparclinux
From: Martin Habets <errandir_news@mph.eclipse.co.uk>
Date: Thu, 29 Jun 2006 18:08:56 +0100
> On Wed, Jun 28, 2006 at 10:05:52AM -0700, Raymond Burns wrote:
> > Warning: unable to open an initial console.
>
> This is probably an different issue then. Best start a new thread
> and post the console output, kernel version, if you're using udev
> or devfs, 'ls -l /dev/console'.
Agreed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] sparc: remove sunzilog_console_init
2006-06-28 14:16 [PATCH] sparc: remove sunzilog_console_init Martin Habets
` (7 preceding siblings ...)
2006-06-29 19:54 ` David Miller
@ 2006-06-29 22:19 ` Raymond Burns
8 siblings, 0 replies; 10+ messages in thread
From: Raymond Burns @ 2006-06-29 22:19 UTC (permalink / raw)
To: sparclinux
Hi
On further review, console_init is called at an inapropriate time,
prior to probing the prom for zilog serial ports
On the other hand, SUNZILOG_CONSOLE is called out while probing /
performing initialization of the serial ports.
Your solution appears correct.
Thanx
Ray
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-06-29 22:19 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-28 14:16 [PATCH] sparc: remove sunzilog_console_init Martin Habets
2006-06-28 14:34 ` Martin Habets
2006-06-28 16:43 ` Raymond Burns
2006-06-28 18:32 ` David Miller
2006-06-28 18:35 ` David Miller
2006-06-29 17:02 ` Martin Habets
2006-06-29 17:08 ` Martin Habets
2006-06-29 19:53 ` David Miller
2006-06-29 19:54 ` David Miller
2006-06-29 22:19 ` Raymond Burns
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.