summaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_imx.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-02-25 14:29:48 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-02-25 15:16:14 +0100
commit0f7b86f1cbba9f7ecd3004107ab40fa96e122032 (patch)
treebc18bdbaffe24d0c48751cb3b29dfde1f3437d92 /drivers/serial/serial_imx.c
parentb059ed81848be5e55e401b876a6de1038486431a (diff)
downloadbarebox-0f7b86f1cbba9f7ecd3004107ab40fa96e122032.tar.gz
serial imx: fix unregister
- Add missing console_unregister call - use dev->priv instead of dev->type_data Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial/serial_imx.c')
-rw-r--r--drivers/serial/serial_imx.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
index 8547f36..72771fc 100644
--- a/drivers/serial/serial_imx.c
+++ b/drivers/serial/serial_imx.c
@@ -322,9 +322,9 @@ static int imx_serial_probe(struct device_d *dev)
priv = xzalloc(sizeof(*priv));
cdev = &priv->cdev;
+ dev->priv = priv;
priv->regs = dev_request_mem_region(dev, 0);
- dev->type_data = cdev;
cdev->dev = dev;
cdev->f_caps = CONSOLE_STDIN | CONSOLE_STDOUT | CONSOLE_STDERR;
cdev->tstc = imx_serial_tstc;
@@ -350,9 +350,11 @@ static int imx_serial_probe(struct device_d *dev)
static void imx_serial_remove(struct device_d *dev)
{
- struct console_device *cdev = dev->type_data;
+ struct imx_serial_priv *priv = dev->priv;
- imx_serial_flush(cdev);
+ imx_serial_flush(&priv->cdev);
+ console_unregister(&priv->cdev);
+ free(priv);
}
static struct driver_d imx_serial_driver = {