summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/mpc52xx_uart.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-05-23 10:39:36 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-03 17:21:33 (GMT)
commit696faedd616e202f5c510cd03dcc8853c11ca6db (patch)
tree45ebab791238ff927788d9ae31bde7f59b506060 /drivers/tty/serial/mpc52xx_uart.c
parent9d141cb97703439255e21bbc95903eda32324a3d (diff)
downloadlinux-696faedd616e202f5c510cd03dcc8853c11ca6db.tar.xz
serial: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/mpc52xx_uart.c')
-rw-r--r--drivers/tty/serial/mpc52xx_uart.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
index 510fa98..2c03904 100644
--- a/drivers/tty/serial/mpc52xx_uart.c
+++ b/drivers/tty/serial/mpc52xx_uart.c
@@ -1362,15 +1362,14 @@ static int mpc52xx_uart_of_probe(struct platform_device *op)
if (ret)
return ret;
- dev_set_drvdata(&op->dev, (void *)port);
+ platform_set_drvdata(op, (void *)port);
return 0;
}
static int
mpc52xx_uart_of_remove(struct platform_device *op)
{
- struct uart_port *port = dev_get_drvdata(&op->dev);
- dev_set_drvdata(&op->dev, NULL);
+ struct uart_port *port = platform_get_drvdata(op);
if (port)
uart_remove_one_port(&mpc52xx_uart_driver, port);
@@ -1382,7 +1381,7 @@ mpc52xx_uart_of_remove(struct platform_device *op)
static int
mpc52xx_uart_of_suspend(struct platform_device *op, pm_message_t state)
{
- struct uart_port *port = (struct uart_port *) dev_get_drvdata(&op->dev);
+ struct uart_port *port = (struct uart_port *) platform_get_drvdata(op);
if (port)
uart_suspend_port(&mpc52xx_uart_driver, port);
@@ -1393,7 +1392,7 @@ mpc52xx_uart_of_suspend(struct platform_device *op, pm_message_t state)
static int
mpc52xx_uart_of_resume(struct platform_device *op)
{
- struct uart_port *port = (struct uart_port *) dev_get_drvdata(&op->dev);
+ struct uart_port *port = (struct uart_port *) platform_get_drvdata(op);
if (port)
uart_resume_port(&mpc52xx_uart_driver, port);