diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-06-24 21:08:49 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:00:50 -0400 |
commit | b0262f5a6904b76471faf5c20cfba093b3d0e713 (patch) | |
tree | 8e455d2059b32a7b13c1e379bb73e276aa1c613c /drivers/tty | |
parent | 28a0026ca3bdcebec54b550581016d906e5fa2db (diff) |
serial: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Barry Song <baohua.song@csr.com>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/ar933x_uart.c | 1 | ||||
-rw-r--r-- | drivers/tty/serial/atmel_serial.c | 1 | ||||
-rw-r--r-- | drivers/tty/serial/bcm63xx_uart.c | 1 | ||||
-rw-r--r-- | drivers/tty/serial/clps711x.c | 11 | ||||
-rw-r--r-- | drivers/tty/serial/efm32-uart.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/imx.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/netx-serial.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/pmac_zilog.c | 1 | ||||
-rw-r--r-- | drivers/tty/serial/pnx8xxx_uart.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/pxa.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/sa1100.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/sccnxp.c | 3 | ||||
-rw-r--r-- | drivers/tty/serial/sirfsoc_uart.c | 3 | ||||
-rw-r--r-- | drivers/tty/serial/vt8500_serial.c | 1 |
14 files changed, 3 insertions, 31 deletions
diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index 27f20c57abed..9824dfb1e4fe 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c | |||
@@ -703,7 +703,6 @@ static int ar933x_uart_remove(struct platform_device *pdev) | |||
703 | struct ar933x_uart_port *up; | 703 | struct ar933x_uart_port *up; |
704 | 704 | ||
705 | up = platform_get_drvdata(pdev); | 705 | up = platform_get_drvdata(pdev); |
706 | platform_set_drvdata(pdev, NULL); | ||
707 | 706 | ||
708 | if (up) { | 707 | if (up) { |
709 | uart_remove_one_port(&ar933x_uart_driver, &up->port); | 708 | uart_remove_one_port(&ar933x_uart_driver, &up->port); |
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 82127ac26d6f..dc59c3620bd9 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c | |||
@@ -1853,7 +1853,6 @@ static int atmel_serial_remove(struct platform_device *pdev) | |||
1853 | int ret = 0; | 1853 | int ret = 0; |
1854 | 1854 | ||
1855 | device_init_wakeup(&pdev->dev, 0); | 1855 | device_init_wakeup(&pdev->dev, 0); |
1856 | platform_set_drvdata(pdev, NULL); | ||
1857 | 1856 | ||
1858 | ret = uart_remove_one_port(&atmel_uart, port); | 1857 | ret = uart_remove_one_port(&atmel_uart, port); |
1859 | 1858 | ||
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c index 6fa2ae77fffd..d14ba5aa2ec7 100644 --- a/drivers/tty/serial/bcm63xx_uart.c +++ b/drivers/tty/serial/bcm63xx_uart.c | |||
@@ -852,7 +852,6 @@ static int bcm_uart_remove(struct platform_device *pdev) | |||
852 | 852 | ||
853 | port = platform_get_drvdata(pdev); | 853 | port = platform_get_drvdata(pdev); |
854 | uart_remove_one_port(&bcm_uart_driver, port); | 854 | uart_remove_one_port(&bcm_uart_driver, port); |
855 | platform_set_drvdata(pdev, NULL); | ||
856 | /* mark port as free */ | 855 | /* mark port as free */ |
857 | ports[pdev->id].membase = 0; | 856 | ports[pdev->id].membase = 0; |
858 | return 0; | 857 | return 0; |
diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index bfb17968c8db..7e4e4088471c 100644 --- a/drivers/tty/serial/clps711x.c +++ b/drivers/tty/serial/clps711x.c | |||
@@ -438,8 +438,7 @@ static int uart_clps711x_probe(struct platform_device *pdev) | |||
438 | s->uart_clk = devm_clk_get(&pdev->dev, "uart"); | 438 | s->uart_clk = devm_clk_get(&pdev->dev, "uart"); |
439 | if (IS_ERR(s->uart_clk)) { | 439 | if (IS_ERR(s->uart_clk)) { |
440 | dev_err(&pdev->dev, "Can't get UART clocks\n"); | 440 | dev_err(&pdev->dev, "Can't get UART clocks\n"); |
441 | ret = PTR_ERR(s->uart_clk); | 441 | return PTR_ERR(s->uart_clk); |
442 | goto err_out; | ||
443 | } | 442 | } |
444 | 443 | ||
445 | s->uart.owner = THIS_MODULE; | 444 | s->uart.owner = THIS_MODULE; |
@@ -461,7 +460,7 @@ static int uart_clps711x_probe(struct platform_device *pdev) | |||
461 | if (ret) { | 460 | if (ret) { |
462 | dev_err(&pdev->dev, "Registering UART driver failed\n"); | 461 | dev_err(&pdev->dev, "Registering UART driver failed\n"); |
463 | devm_clk_put(&pdev->dev, s->uart_clk); | 462 | devm_clk_put(&pdev->dev, s->uart_clk); |
464 | goto err_out; | 463 | return ret; |
465 | } | 464 | } |
466 | 465 | ||
467 | for (i = 0; i < UART_CLPS711X_NR; i++) { | 466 | for (i = 0; i < UART_CLPS711X_NR; i++) { |
@@ -478,11 +477,6 @@ static int uart_clps711x_probe(struct platform_device *pdev) | |||
478 | } | 477 | } |
479 | 478 | ||
480 | return 0; | 479 | return 0; |
481 | |||
482 | err_out: | ||
483 | platform_set_drvdata(pdev, NULL); | ||
484 | |||
485 | return ret; | ||
486 | } | 480 | } |
487 | 481 | ||
488 | static int uart_clps711x_remove(struct platform_device *pdev) | 482 | static int uart_clps711x_remove(struct platform_device *pdev) |
@@ -495,7 +489,6 @@ static int uart_clps711x_remove(struct platform_device *pdev) | |||
495 | 489 | ||
496 | devm_clk_put(&pdev->dev, s->uart_clk); | 490 | devm_clk_put(&pdev->dev, s->uart_clk); |
497 | uart_unregister_driver(&s->uart); | 491 | uart_unregister_driver(&s->uart); |
498 | platform_set_drvdata(pdev, NULL); | ||
499 | 492 | ||
500 | return 0; | 493 | return 0; |
501 | } | 494 | } |
diff --git a/drivers/tty/serial/efm32-uart.c b/drivers/tty/serial/efm32-uart.c index 7d199c8e1a75..e029907cf430 100644 --- a/drivers/tty/serial/efm32-uart.c +++ b/drivers/tty/serial/efm32-uart.c | |||
@@ -778,8 +778,6 @@ static int efm32_uart_remove(struct platform_device *pdev) | |||
778 | { | 778 | { |
779 | struct efm32_uart_port *efm_port = platform_get_drvdata(pdev); | 779 | struct efm32_uart_port *efm_port = platform_get_drvdata(pdev); |
780 | 780 | ||
781 | platform_set_drvdata(pdev, NULL); | ||
782 | |||
783 | uart_remove_one_port(&efm32_uart_reg, &efm_port->port); | 781 | uart_remove_one_port(&efm32_uart_reg, &efm_port->port); |
784 | 782 | ||
785 | if (pdev->id >= 0 && pdev->id < ARRAY_SIZE(efm32_uart_ports)) | 783 | if (pdev->id >= 0 && pdev->id < ARRAY_SIZE(efm32_uart_ports)) |
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 415cec62073f..7b0f956edfa8 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
@@ -1605,8 +1605,6 @@ static int serial_imx_remove(struct platform_device *pdev) | |||
1605 | 1605 | ||
1606 | pdata = pdev->dev.platform_data; | 1606 | pdata = pdev->dev.platform_data; |
1607 | 1607 | ||
1608 | platform_set_drvdata(pdev, NULL); | ||
1609 | |||
1610 | uart_remove_one_port(&imx_reg, &sport->port); | 1608 | uart_remove_one_port(&imx_reg, &sport->port); |
1611 | 1609 | ||
1612 | if (pdata && pdata->exit) | 1610 | if (pdata && pdata->exit) |
diff --git a/drivers/tty/serial/netx-serial.c b/drivers/tty/serial/netx-serial.c index b9a40ed70be2..ce04f3f8c547 100644 --- a/drivers/tty/serial/netx-serial.c +++ b/drivers/tty/serial/netx-serial.c | |||
@@ -693,8 +693,6 @@ static int serial_netx_remove(struct platform_device *pdev) | |||
693 | { | 693 | { |
694 | struct netx_port *sport = platform_get_drvdata(pdev); | 694 | struct netx_port *sport = platform_get_drvdata(pdev); |
695 | 695 | ||
696 | platform_set_drvdata(pdev, NULL); | ||
697 | |||
698 | if (sport) | 696 | if (sport) |
699 | uart_remove_one_port(&netx_reg, &sport->port); | 697 | uart_remove_one_port(&netx_reg, &sport->port); |
700 | 698 | ||
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index 7735bbdccbc9..5ba30e078236 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c | |||
@@ -1798,7 +1798,6 @@ static int __exit pmz_detach(struct platform_device *pdev) | |||
1798 | 1798 | ||
1799 | uart_remove_one_port(&pmz_uart_reg, &uap->port); | 1799 | uart_remove_one_port(&pmz_uart_reg, &uap->port); |
1800 | 1800 | ||
1801 | platform_set_drvdata(pdev, NULL); | ||
1802 | uap->port.dev = NULL; | 1801 | uap->port.dev = NULL; |
1803 | 1802 | ||
1804 | return 0; | 1803 | return 0; |
diff --git a/drivers/tty/serial/pnx8xxx_uart.c b/drivers/tty/serial/pnx8xxx_uart.c index 7e277a5384a7..b6b7aca5707a 100644 --- a/drivers/tty/serial/pnx8xxx_uart.c +++ b/drivers/tty/serial/pnx8xxx_uart.c | |||
@@ -801,8 +801,6 @@ static int pnx8xxx_serial_remove(struct platform_device *pdev) | |||
801 | { | 801 | { |
802 | struct pnx8xxx_port *sport = platform_get_drvdata(pdev); | 802 | struct pnx8xxx_port *sport = platform_get_drvdata(pdev); |
803 | 803 | ||
804 | platform_set_drvdata(pdev, NULL); | ||
805 | |||
806 | if (sport) | 804 | if (sport) |
807 | uart_remove_one_port(&pnx8xxx_reg, &sport->port); | 805 | uart_remove_one_port(&pnx8xxx_reg, &sport->port); |
808 | 806 | ||
diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c index 05f504e0c271..ac8b2f5b2396 100644 --- a/drivers/tty/serial/pxa.c +++ b/drivers/tty/serial/pxa.c | |||
@@ -945,8 +945,6 @@ static int serial_pxa_remove(struct platform_device *dev) | |||
945 | { | 945 | { |
946 | struct uart_pxa_port *sport = platform_get_drvdata(dev); | 946 | struct uart_pxa_port *sport = platform_get_drvdata(dev); |
947 | 947 | ||
948 | platform_set_drvdata(dev, NULL); | ||
949 | |||
950 | uart_remove_one_port(&serial_pxa_reg, &sport->port); | 948 | uart_remove_one_port(&serial_pxa_reg, &sport->port); |
951 | 949 | ||
952 | clk_unprepare(sport->clk); | 950 | clk_unprepare(sport->clk); |
diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c index af6b3e3ad24d..fc23ea19073a 100644 --- a/drivers/tty/serial/sa1100.c +++ b/drivers/tty/serial/sa1100.c | |||
@@ -864,8 +864,6 @@ static int sa1100_serial_remove(struct platform_device *pdev) | |||
864 | { | 864 | { |
865 | struct sa1100_port *sport = platform_get_drvdata(pdev); | 865 | struct sa1100_port *sport = platform_get_drvdata(pdev); |
866 | 866 | ||
867 | platform_set_drvdata(pdev, NULL); | ||
868 | |||
869 | if (sport) | 867 | if (sport) |
870 | uart_remove_one_port(&sa1100_reg, &sport->port); | 868 | uart_remove_one_port(&sa1100_reg, &sport->port); |
871 | 869 | ||
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c index c77304155410..98555179fe10 100644 --- a/drivers/tty/serial/sccnxp.c +++ b/drivers/tty/serial/sccnxp.c | |||
@@ -997,8 +997,6 @@ static int sccnxp_probe(struct platform_device *pdev) | |||
997 | } | 997 | } |
998 | 998 | ||
999 | err_out: | 999 | err_out: |
1000 | platform_set_drvdata(pdev, NULL); | ||
1001 | |||
1002 | return ret; | 1000 | return ret; |
1003 | } | 1001 | } |
1004 | 1002 | ||
@@ -1016,7 +1014,6 @@ static int sccnxp_remove(struct platform_device *pdev) | |||
1016 | uart_remove_one_port(&s->uart, &s->port[i]); | 1014 | uart_remove_one_port(&s->uart, &s->port[i]); |
1017 | 1015 | ||
1018 | uart_unregister_driver(&s->uart); | 1016 | uart_unregister_driver(&s->uart); |
1019 | platform_set_drvdata(pdev, NULL); | ||
1020 | 1017 | ||
1021 | if (!IS_ERR(s->regulator)) | 1018 | if (!IS_ERR(s->regulator)) |
1022 | return regulator_disable(s->regulator); | 1019 | return regulator_disable(s->regulator); |
diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c index 03465b673945..f2564402e2e8 100644 --- a/drivers/tty/serial/sirfsoc_uart.c +++ b/drivers/tty/serial/sirfsoc_uart.c | |||
@@ -716,7 +716,6 @@ port_err: | |||
716 | clk_disable_unprepare(sirfport->clk); | 716 | clk_disable_unprepare(sirfport->clk); |
717 | clk_put(sirfport->clk); | 717 | clk_put(sirfport->clk); |
718 | clk_err: | 718 | clk_err: |
719 | platform_set_drvdata(pdev, NULL); | ||
720 | if (sirfport->hw_flow_ctrl) | 719 | if (sirfport->hw_flow_ctrl) |
721 | pinctrl_put(sirfport->p); | 720 | pinctrl_put(sirfport->p); |
722 | err: | 721 | err: |
@@ -727,7 +726,7 @@ static int sirfsoc_uart_remove(struct platform_device *pdev) | |||
727 | { | 726 | { |
728 | struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev); | 727 | struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev); |
729 | struct uart_port *port = &sirfport->port; | 728 | struct uart_port *port = &sirfport->port; |
730 | platform_set_drvdata(pdev, NULL); | 729 | |
731 | if (sirfport->hw_flow_ctrl) | 730 | if (sirfport->hw_flow_ctrl) |
732 | pinctrl_put(sirfport->p); | 731 | pinctrl_put(sirfport->p); |
733 | clk_disable_unprepare(sirfport->clk); | 732 | clk_disable_unprepare(sirfport->clk); |
diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c index f72b43fbbef9..0d4a35275657 100644 --- a/drivers/tty/serial/vt8500_serial.c +++ b/drivers/tty/serial/vt8500_serial.c | |||
@@ -631,7 +631,6 @@ static int vt8500_serial_remove(struct platform_device *pdev) | |||
631 | { | 631 | { |
632 | struct vt8500_port *vt8500_port = platform_get_drvdata(pdev); | 632 | struct vt8500_port *vt8500_port = platform_get_drvdata(pdev); |
633 | 633 | ||
634 | platform_set_drvdata(pdev, NULL); | ||
635 | clk_disable_unprepare(vt8500_port->clk); | 634 | clk_disable_unprepare(vt8500_port->clk); |
636 | uart_remove_one_port(&vt8500_uart_driver, &vt8500_port->uart); | 635 | uart_remove_one_port(&vt8500_uart_driver, &vt8500_port->uart); |
637 | 636 | ||