9
0
Fork 0

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>
This commit is contained in:
Sascha Hauer 2012-02-25 14:29:48 +01:00
parent b059ed8184
commit 0f7b86f1cb
1 changed files with 5 additions and 3 deletions

View File

@ -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 = {