summaryrefslogtreecommitdiff
path: root/drivers/serial/sunhv.c
diff options
context:
space:
mode:
authorMartin Habets <errandir_news@mph.eclipse.co.uk>2007-12-11 03:37:04 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2007-12-12 07:36:34 -0800
commit58d784a5c754cd66ecd4791222162504d3c16c74 (patch)
treea25670e8dd1569cf5084af790873b246f45134c3 /drivers/serial/sunhv.c
parent4af75653031c6d454b4ace47c1536f0d2e727e3e (diff)
[SERIAL] sparc: Infrastructure to fix section mismatch bugs.
This patch against 2.6.23 sparc-2.6.git contains a number of minor cleanups of the sparc serial drivers. Initially I fixed this build warning: WARNING: vmlinux.o(.text+0x107a2c): Section mismatch: reference to .init.text:add_preferred_console (between 'sunserial_console_match' and 'sunserial_console_termios') which is done by declaring sunserial_console_match() as __init. This resulted in build warnings on sunserial_current_minor. To resolve these the variable was changed so it is no longer global, and to hide operations on it inside 2 new functions. These functions handle the UART minor handling code that is common to all sparc serial drivers. These changes allowed to clean up the uart counters in all the sparc serial drivers, and the administration of minor device numbers. Lastly, sunserial_console_termios() does not need to be exported since it is only called from non-modular code. Sadly, the following build warning still exists: WARNING: vmlinux.o(__ksymtab+0x2910): Section mismatch: reference to .init.text:sunserial_console_match (between '__ksymtab_sunserial_console_match' and '__ksymtab_sunserial_unregister_minors') This could be resolved by not exporting sunserial_console_match(), but this is not possible at the moment because it is being called from modular code. On the other hand, this is a bogus warning since it comes from a ksymtab section. Signed-off-by: Martin Habets <errandir_news@mph.eclipse.co.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/serial/sunhv.c')
-rw-r--r--drivers/serial/sunhv.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index 8ff900b09811..be0fe152891b 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -562,16 +562,10 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m
port->dev = &op->dev;
- sunhv_reg.minor = sunserial_current_minor;
- sunhv_reg.nr = 1;
-
- err = uart_register_driver(&sunhv_reg);
+ err = sunserial_register_minors(&sunhv_reg, 1);
if (err)
goto out_free_con_read_page;
- sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64;
- sunserial_current_minor += 1;
-
sunserial_console_match(&sunhv_console, op->node,
&sunhv_reg, port->line);
@@ -591,8 +585,7 @@ out_remove_port:
uart_remove_one_port(&sunhv_reg, port);
out_unregister_driver:
- sunserial_current_minor -= 1;
- uart_unregister_driver(&sunhv_reg);
+ sunserial_unregister_minors(&sunhv_reg, 1);
out_free_con_read_page:
kfree(con_read_page);
@@ -614,8 +607,7 @@ static int __devexit hv_remove(struct of_device *dev)
uart_remove_one_port(&sunhv_reg, port);
- sunserial_current_minor -= 1;
- uart_unregister_driver(&sunhv_reg);
+ sunserial_unregister_minors(&sunhv_reg, 1);
kfree(port);
sunhv_port = NULL;