sparc: remove sunzilog_console_init
PATCH 1/1 sparc: remove sunzilog_console_init
Hi,
This patch against 2.6.17 resolves the following build warning:
CC drivers/serial/sunzilog.odrivers/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
drivers/serial/sunzilog.c renamed from drivers/serial/sunzilog.c.old +0 -23
@@ -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 /*
PATCH 1/1 sparc: remove sunzilog_console_init
Hi,
This patch against 2.6.17 resolves the following build warning:
CC drivers/serial/sunzilog.odrivers/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
---
drivers/serial/sunzilog.c renamed from drivers/serial/sunzilog.c.old +0 -23
@@ -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 /*
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?
Quoted 52 lines · Martin Habets
Hi,
This patch against 2.6.17 resolves the following build warning:
CCdrivers/serial/sunzilog.odrivers/serial/sunzilog.c:1390: warning: `sunzilog_console_init' defined but not usedIt was tested on a SS20 with the console on a sunzilog.
Martin
Signed-off-by Martin Habets <[email protected]>---
drivers/serial/sunzilog.c renamed from drivers/serial/sunzilog.c.old +0
-24@@ -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 /* -
Quoted 4 lines
To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanx
Ray
From: Martin Habets <[email protected]>
Date: Wed, 28 Jun 2006 15:16:01 +0100
Quoted 5 lines
This patch against 2.6.17 resolves the following build warning:
CCdrivers/serial/sunzilog.odrivers/serial/sunzilog.c:1390: warning: `sunzilog_console_init' defined but not usedIt 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.
From: Martin Habets <[email protected]>
Date: Wed, 28 Jun 2006 15:34:02 +0100
Quoted 1 line
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?
Quoted 9 lines · David Miller
From: Martin Habets <[email protected]>
Date: Wed, 28 Jun 2006 15:34:02 +0100Quoted 1 line
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 ofsunzilog_regright?
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.
Quoted 3 lines
Quoted 3 lines
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.
Signature · 1 line
Martin
Quoted 7 lines · Raymond Burns
Hi
Odd but I went the other direction, I added the line:
console_initcall(sunzilog_console_init);near the bottom of the
sunzilog.cfile.
Yes, that would work too. Basically restoring part of the 2.6.16 code.
Quoted 4 lines
which removes the compiler warning but did not solve the trouble I have where
/dev/consolecannot 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'.
Quoted 4 lines
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.
Signature · 1 line
Martin
From: Martin Habets <[email protected]>
Date: Thu, 29 Jun 2006 18:02:09 +0100
Quoted 11 lines · David Miller
Quoted 9 lines
From: Martin Habets <[email protected]>
Date: Wed, 28 Jun 2006 15:34:02 +0100Quoted 1 line
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 ofsunzilog_regright?
Quoted 6 lines
Yes,
sunzilog_ports_initcallsuart_add_one_port, which callsregister_console(at serial_core.c:2270) with the newSUNZILOG_CONSOLEfunction.It's all more convoluted, but effectively
SUNZILOG_CONSOLEhas replacedsunzilog_console_init.
Thanks, I've integrated your fix into my tree.
From: Martin Habets <[email protected]>
Date: Thu, 29 Jun 2006 18:08:56 +0100
Quoted 6 lines · Raymond Burns
Quoted 1 line
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.
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