diff options
author | Paul Mackerras <paulus@samba.org> | 2007-12-21 12:21:08 +0100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-21 12:21:08 +0100 |
commit | c2a7dcad9f0d92d7a96e735abb8bec7b9c621536 (patch) | |
tree | bf9b20fdd5ab07e5b0e4e0b95c6a3dbab1005cb9 /drivers/serial/sunsu.c | |
parent | [POWERPC] Make non-PCI build work again (diff) | |
parent | Linux 2.6.24-rc6 (diff) | |
download | linux-c2a7dcad9f0d92d7a96e735abb8bec7b9c621536.tar.xz linux-c2a7dcad9f0d92d7a96e735abb8bec7b9c621536.zip |
Merge branch 'linux-2.6'
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); |