[PATCH -next 1/3] staging/fwserial: Destruct embedded tty_port on teardown

2012-11-27 Thread Peter Hurley
For TTY drivers that manage the port lifetime, the tty_port should
to be specifically destructed when the port lifetime ends. Now that
a method has been added to do this, use it.

Signed-off-by: Peter Hurley 
Cc: Jiri Slaby 
Cc: Alan Cox 
---
 drivers/staging/fwserial/fwserial.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/fwserial/fwserial.c 
b/drivers/staging/fwserial/fwserial.c
index 5d4d64a..99a2d2d 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -955,6 +955,7 @@ static void fwserial_destroy(struct kref *kref)
for (j = 0; j < num_ports; ++j) {
fw_core_remove_address_handler([j]->rx_handler);
dma_fifo_free([j]->tx_fifo);
+   tty_port_destroy([j]->port);
kfree(ports[j]);
}
kfree(serial);
@@ -2369,8 +2370,10 @@ unregister_ttys:
return err;
 
 free_ports:
-   for (--i; i >= 0; --i)
+   for (--i; i >= 0; --i) {
+   tty_port_destroy(>ports[i]->port);
kfree(serial->ports[i]);
+   }
kfree(serial);
return err;
 }
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH -next 1/3] staging/fwserial: Destruct embedded tty_port on teardown

2012-11-27 Thread Peter Hurley
For TTY drivers that manage the port lifetime, the tty_port should
to be specifically destructed when the port lifetime ends. Now that
a method has been added to do this, use it.

Signed-off-by: Peter Hurley pe...@hurleysoftware.com
Cc: Jiri Slaby jsl...@suse.cz
Cc: Alan Cox a...@linux.intel.com
---
 drivers/staging/fwserial/fwserial.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/fwserial/fwserial.c 
b/drivers/staging/fwserial/fwserial.c
index 5d4d64a..99a2d2d 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -955,6 +955,7 @@ static void fwserial_destroy(struct kref *kref)
for (j = 0; j  num_ports; ++j) {
fw_core_remove_address_handler(ports[j]-rx_handler);
dma_fifo_free(ports[j]-tx_fifo);
+   tty_port_destroy(ports[j]-port);
kfree(ports[j]);
}
kfree(serial);
@@ -2369,8 +2370,10 @@ unregister_ttys:
return err;
 
 free_ports:
-   for (--i; i = 0; --i)
+   for (--i; i = 0; --i) {
+   tty_port_destroy(serial-ports[i]-port);
kfree(serial-ports[i]);
+   }
kfree(serial);
return err;
 }
-- 
1.8.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/