diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-05-23 06:39:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-03 13:21:33 -0400 |
commit | 696faedd616e202f5c510cd03dcc8853c11ca6db (patch) | |
tree | 45ebab791238ff927788d9ae31bde7f59b506060 /drivers/tty/serial/sunzilog.c | |
parent | 9d141cb97703439255e21bbc95903eda32324a3d (diff) |
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/sunzilog.c')
-rw-r--r-- | drivers/tty/serial/sunzilog.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c index 813ef8eb8eff..135a15203532 100644 --- a/drivers/tty/serial/sunzilog.c +++ b/drivers/tty/serial/sunzilog.c | |||
@@ -1495,7 +1495,7 @@ static int zs_probe(struct platform_device *op) | |||
1495 | kbm_inst++; | 1495 | kbm_inst++; |
1496 | } | 1496 | } |
1497 | 1497 | ||
1498 | dev_set_drvdata(&op->dev, &up[0]); | 1498 | platform_set_drvdata(op, &up[0]); |
1499 | 1499 | ||
1500 | return 0; | 1500 | return 0; |
1501 | } | 1501 | } |
@@ -1512,7 +1512,7 @@ static void zs_remove_one(struct uart_sunzilog_port *up) | |||
1512 | 1512 | ||
1513 | static int zs_remove(struct platform_device *op) | 1513 | static int zs_remove(struct platform_device *op) |
1514 | { | 1514 | { |
1515 | struct uart_sunzilog_port *up = dev_get_drvdata(&op->dev); | 1515 | struct uart_sunzilog_port *up = platform_get_drvdata(op); |
1516 | struct zilog_layout __iomem *regs; | 1516 | struct zilog_layout __iomem *regs; |
1517 | 1517 | ||
1518 | zs_remove_one(&up[0]); | 1518 | zs_remove_one(&up[0]); |
@@ -1521,8 +1521,6 @@ static int zs_remove(struct platform_device *op) | |||
1521 | regs = sunzilog_chip_regs[up[0].port.line / 2]; | 1521 | regs = sunzilog_chip_regs[up[0].port.line / 2]; |
1522 | of_iounmap(&op->resource[0], regs, sizeof(struct zilog_layout)); | 1522 | of_iounmap(&op->resource[0], regs, sizeof(struct zilog_layout)); |
1523 | 1523 | ||
1524 | dev_set_drvdata(&op->dev, NULL); | ||
1525 | |||
1526 | return 0; | 1524 | return 0; |
1527 | } | 1525 | } |
1528 | 1526 | ||