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/sunsu.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/sunsu.c')
-rw-r--r-- | drivers/tty/serial/sunsu.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c index 0d8465728473..699cc1b5f6aa 100644 --- a/drivers/tty/serial/sunsu.c +++ b/drivers/tty/serial/sunsu.c | |||
@@ -1454,7 +1454,7 @@ static int su_probe(struct platform_device *op) | |||
1454 | kfree(up); | 1454 | kfree(up); |
1455 | return err; | 1455 | return err; |
1456 | } | 1456 | } |
1457 | dev_set_drvdata(&op->dev, up); | 1457 | platform_set_drvdata(op, up); |
1458 | 1458 | ||
1459 | nr_inst++; | 1459 | nr_inst++; |
1460 | 1460 | ||
@@ -1483,7 +1483,7 @@ static int su_probe(struct platform_device *op) | |||
1483 | if (err) | 1483 | if (err) |
1484 | goto out_unmap; | 1484 | goto out_unmap; |
1485 | 1485 | ||
1486 | dev_set_drvdata(&op->dev, up); | 1486 | platform_set_drvdata(op, up); |
1487 | 1487 | ||
1488 | nr_inst++; | 1488 | nr_inst++; |
1489 | 1489 | ||
@@ -1496,7 +1496,7 @@ out_unmap: | |||
1496 | 1496 | ||
1497 | static int su_remove(struct platform_device *op) | 1497 | static int su_remove(struct platform_device *op) |
1498 | { | 1498 | { |
1499 | struct uart_sunsu_port *up = dev_get_drvdata(&op->dev); | 1499 | struct uart_sunsu_port *up = platform_get_drvdata(op); |
1500 | bool kbdms = false; | 1500 | bool kbdms = false; |
1501 | 1501 | ||
1502 | if (up->su_type == SU_PORT_MS || | 1502 | if (up->su_type == SU_PORT_MS || |
@@ -1516,8 +1516,6 @@ static int su_remove(struct platform_device *op) | |||
1516 | if (kbdms) | 1516 | if (kbdms) |
1517 | kfree(up); | 1517 | kfree(up); |
1518 | 1518 | ||
1519 | dev_set_drvdata(&op->dev, NULL); | ||
1520 | |||
1521 | return 0; | 1519 | return 0; |
1522 | } | 1520 | } |
1523 | 1521 | ||