[PATCH 05/13] serial pxa: fix unregister

Sascha Hauer s.hauer at pengutronix.de
Sat Feb 25 10:51:02 EST 2012


- Add missing console_unregister call
- use dev->priv instead of dev->type_data

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/serial/serial_pxa.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/serial_pxa.c b/drivers/serial/serial_pxa.c
index d295235..1365413 100644
--- a/drivers/serial/serial_pxa.c
+++ b/drivers/serial/serial_pxa.c
@@ -168,7 +168,7 @@ static int pxa_serial_probe(struct device_d *dev)
 	cdev = &priv->cdev;
 	priv->regs = dev_request_mem_region(dev, 0);
 
-	dev->type_data = cdev;
+	dev->priv = priv
 	cdev->dev = dev;
 	cdev->f_caps = CONSOLE_STDIN | CONSOLE_STDOUT | CONSOLE_STDERR;
 	cdev->tstc = pxa_serial_tstc;
@@ -184,7 +184,10 @@ static int pxa_serial_probe(struct device_d *dev)
 
 static void pxa_serial_remove(struct device_d *dev)
 {
-	free(dev->type_data);
+	struct pxa_serial_priv *priv = dev->priv;
+
+	console_unregister(&priv->cdev);
+	free(priv);
 }
 
 static struct driver_d pxa_serial_driver = {
-- 
1.7.9.1




More information about the barebox mailing list