diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-12 09:52:12 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-12 09:52:12 -0800 |
commit | da8cadb31b82c9d41fc593c8deab6aa20b162d6b (patch) | |
tree | 5640a34aa485f254de503a17833046645ade47f6 /drivers/serial/sunsu.c | |
parent | 02ec96be2b45d9f2712687ad107038ef390b24c2 (diff) | |
parent | 0de56d1ab83323d604d95ca193dcbd28388dbabb (diff) | |
download | linux-da8cadb31b82c9d41fc593c8deab6aa20b162d6b.tar.gz linux-da8cadb31b82c9d41fc593c8deab6aa20b162d6b.tar.bz2 linux-da8cadb31b82c9d41fc593c8deab6aa20b162d6b.zip |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Fix endless loop in cheetah_xcall_deliver().
[SERIAL] sparc: Infrastructure to fix section mismatch bugs.
Diffstat (limited to 'drivers/serial/sunsu.c')
-rw-r--r-- | drivers/serial/sunsu.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index e074943feff5..4e2302d43ab1 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c @@ -1528,14 +1528,12 @@ static struct of_platform_driver su_driver = { .remove = __devexit_p(su_remove), }; -static int num_uart; - static int __init sunsu_init(void) { struct device_node *dp; int err; + int num_uart = 0; - num_uart = 0; for_each_node_by_name(dp, "su") { if (su_get_type(dp) == SU_PORT_PORT) num_uart++; @@ -1552,26 +1550,22 @@ static int __init sunsu_init(void) } if (num_uart) { - sunsu_reg.minor = sunserial_current_minor; - sunsu_reg.nr = num_uart; - err = uart_register_driver(&sunsu_reg); + err = sunserial_register_minors(&sunsu_reg, num_uart); if (err) return err; - sunsu_reg.tty_driver->name_base = sunsu_reg.minor - 64; - sunserial_current_minor += num_uart; } err = of_register_driver(&su_driver, &of_bus_type); if (err && num_uart) - uart_unregister_driver(&sunsu_reg); + sunserial_unregister_minors(&sunsu_reg, num_uart); return err; } static void __exit sunsu_exit(void) { - if (num_uart) - uart_unregister_driver(&sunsu_reg); + if (sunsu_reg.nr) + sunserial_unregister_minors(&sunsu_reg, sunsu_reg.nr); } module_init(sunsu_init); |