Commit b5afcdb2 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Linus Torvalds

[PATCH] fix oops at pmac_zilog rmmod'ing

From: Colin Leroy <colin@colino.net>

rmmod'ing pmac_zilog currently oopses because uart_unregister_driver(),
which nullifies drv->tty_driver, is called before uart_remove_one_port(),
which uses said drv->tty_driver.

The comment at top of uart_unregister_driver() specifically says we have
to have removed all our ports via uart_remove_one_port() before.
parent 62150145
...@@ -1875,9 +1875,6 @@ static void __exit exit_pmz(void) ...@@ -1875,9 +1875,6 @@ static void __exit exit_pmz(void)
/* Get rid of macio-driver (detach from macio) */ /* Get rid of macio-driver (detach from macio) */
macio_unregister_driver(&pmz_driver); macio_unregister_driver(&pmz_driver);
/* Unregister UART driver */
uart_unregister_driver(&pmz_uart_reg);
for (i = 0; i < pmz_ports_count; i++) { for (i = 0; i < pmz_ports_count; i++) {
struct uart_pmac_port *uport = &pmz_ports[i]; struct uart_pmac_port *uport = &pmz_ports[i];
if (uport->node != NULL) { if (uport->node != NULL) {
...@@ -1885,6 +1882,8 @@ static void __exit exit_pmz(void) ...@@ -1885,6 +1882,8 @@ static void __exit exit_pmz(void)
pmz_dispose_port(uport); pmz_dispose_port(uport);
} }
} }
/* Unregister UART driver */
uart_unregister_driver(&pmz_uart_reg);
} }
#ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE #ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment