serial: remove unnecessary platform_set_drvdata()
authorJingoo Han <jg1.han@samsung.com>
Tue, 25 Jun 2013 01:08:49 +0000 (10:08 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2013 22:39:36 +0000 (15:39 -0700)
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>
14 files changed:
drivers/tty/serial/ar933x_uart.c
drivers/tty/serial/atmel_serial.c
drivers/tty/serial/bcm63xx_uart.c
drivers/tty/serial/clps711x.c
drivers/tty/serial/efm32-uart.c
drivers/tty/serial/imx.c
drivers/tty/serial/netx-serial.c
drivers/tty/serial/pmac_zilog.c
drivers/tty/serial/pnx8xxx_uart.c
drivers/tty/serial/pxa.c
drivers/tty/serial/sa1100.c
drivers/tty/serial/sccnxp.c
drivers/tty/serial/sirfsoc_uart.c
drivers/tty/serial/vt8500_serial.c

index 27f20c57abede4ec6874ec4f1de5654b6d618da9..9824dfb1e4fe601ab5ee50f3951a69eaed3e5eb0 100644 (file)
@@ -703,7 +703,6 @@ static int ar933x_uart_remove(struct platform_device *pdev)
        struct ar933x_uart_port *up;
 
        up = platform_get_drvdata(pdev);
-       platform_set_drvdata(pdev, NULL);
 
        if (up) {
                uart_remove_one_port(&ar933x_uart_driver, &up->port);
index 0e39facfcb07c549074d74342c720652ed3f657c..5c17f8dac91bd30be63815288cbe1824f425388b 100644 (file)
@@ -1860,7 +1860,6 @@ static int atmel_serial_remove(struct platform_device *pdev)
        int ret = 0;
 
        device_init_wakeup(&pdev->dev, 0);
-       platform_set_drvdata(pdev, NULL);
 
        ret = uart_remove_one_port(&atmel_uart, port);
 
index 6fa2ae77fffde5a2de2fd14f8568da7fc55f8d1e..d14ba5aa2ec7e0582f88a930fa576b83eb5ee241 100644 (file)
@@ -852,7 +852,6 @@ static int bcm_uart_remove(struct platform_device *pdev)
 
        port = platform_get_drvdata(pdev);
        uart_remove_one_port(&bcm_uart_driver, port);
-       platform_set_drvdata(pdev, NULL);
        /* mark port as free */
        ports[pdev->id].membase = 0;
        return 0;
index bfb17968c8dbbe86ad91902c94f02a824c0a81c3..7e4e4088471cea4cbd6a67c49917b5af2540edc2 100644 (file)
@@ -438,8 +438,7 @@ static int uart_clps711x_probe(struct platform_device *pdev)
        s->uart_clk = devm_clk_get(&pdev->dev, "uart");
        if (IS_ERR(s->uart_clk)) {
                dev_err(&pdev->dev, "Can't get UART clocks\n");
-               ret = PTR_ERR(s->uart_clk);
-               goto err_out;
+               return PTR_ERR(s->uart_clk);
        }
 
        s->uart.owner           = THIS_MODULE;
@@ -461,7 +460,7 @@ static int uart_clps711x_probe(struct platform_device *pdev)
        if (ret) {
                dev_err(&pdev->dev, "Registering UART driver failed\n");
                devm_clk_put(&pdev->dev, s->uart_clk);
-               goto err_out;
+               return ret;
        }
 
        for (i = 0; i < UART_CLPS711X_NR; i++) {
@@ -478,11 +477,6 @@ static int uart_clps711x_probe(struct platform_device *pdev)
        }
 
        return 0;
-
-err_out:
-       platform_set_drvdata(pdev, NULL);
-
-       return ret;
 }
 
 static int uart_clps711x_remove(struct platform_device *pdev)
@@ -495,7 +489,6 @@ static int uart_clps711x_remove(struct platform_device *pdev)
 
        devm_clk_put(&pdev->dev, s->uart_clk);
        uart_unregister_driver(&s->uart);
-       platform_set_drvdata(pdev, NULL);
 
        return 0;
 }
index 7d199c8e1a750949ccb0edae4d2c730eea790bb9..e029907cf4308939bb157607cbe90ce18aad5146 100644 (file)
@@ -778,8 +778,6 @@ static int efm32_uart_remove(struct platform_device *pdev)
 {
        struct efm32_uart_port *efm_port = platform_get_drvdata(pdev);
 
-       platform_set_drvdata(pdev, NULL);
-
        uart_remove_one_port(&efm32_uart_reg, &efm_port->port);
 
        if (pdev->id >= 0 && pdev->id < ARRAY_SIZE(efm32_uart_ports))
index 2797e55d9753a057592fe0280c3ef49239537618..40ca759d1f17a5e1cb56a38fac041d8af497b266 100644 (file)
@@ -1596,8 +1596,6 @@ static int serial_imx_remove(struct platform_device *pdev)
 
        pdata = pdev->dev.platform_data;
 
-       platform_set_drvdata(pdev, NULL);
-
        uart_remove_one_port(&imx_reg, &sport->port);
 
        if (pdata && pdata->exit)
index b9a40ed70be2de379ce98087025447c5652b5ec5..ce04f3f8c547ab93b46856a85db2c908039967c4 100644 (file)
@@ -693,8 +693,6 @@ static int serial_netx_remove(struct platform_device *pdev)
 {
        struct netx_port *sport = platform_get_drvdata(pdev);
 
-       platform_set_drvdata(pdev, NULL);
-
        if (sport)
                uart_remove_one_port(&netx_reg, &sport->port);
 
index b1785f58b6e37e8e70f7242a38f40ae1b71f6b84..f87f1a0c8c6ee577860e37e7a95038e61776e1cb 100644 (file)
@@ -1798,7 +1798,6 @@ static int __exit pmz_detach(struct platform_device *pdev)
 
        uart_remove_one_port(&pmz_uart_reg, &uap->port);
 
-       platform_set_drvdata(pdev, NULL);
        uap->port.dev = NULL;
 
        return 0;
index 7e277a5384a7679d22a64dd92234d3b5c9e17c43..b6b7aca5707a115132ff28df501352cc40bb4652 100644 (file)
@@ -801,8 +801,6 @@ static int pnx8xxx_serial_remove(struct platform_device *pdev)
 {
        struct pnx8xxx_port *sport = platform_get_drvdata(pdev);
 
-       platform_set_drvdata(pdev, NULL);
-
        if (sport)
                uart_remove_one_port(&pnx8xxx_reg, &sport->port);
 
index 05f504e0c27144b04b3b56b075256e6a20f5d4b9..ac8b2f5b2396473c32b011f4f4e7c788c4145508 100644 (file)
@@ -945,8 +945,6 @@ static int serial_pxa_remove(struct platform_device *dev)
 {
        struct uart_pxa_port *sport = platform_get_drvdata(dev);
 
-       platform_set_drvdata(dev, NULL);
-
        uart_remove_one_port(&serial_pxa_reg, &sport->port);
 
        clk_unprepare(sport->clk);
index af6b3e3ad24d18cc48c00736570c8c758403adad..fc23ea19073a40f58850ed60d847d1d9e1c4a4ac 100644 (file)
@@ -864,8 +864,6 @@ static int sa1100_serial_remove(struct platform_device *pdev)
 {
        struct sa1100_port *sport = platform_get_drvdata(pdev);
 
-       platform_set_drvdata(pdev, NULL);
-
        if (sport)
                uart_remove_one_port(&sa1100_reg, &sport->port);
 
index c77304155410169a1a3c040400cc4f23bf38b788..98555179fe10df2ce2ea20b89c22295395a8f028 100644 (file)
@@ -997,8 +997,6 @@ static int sccnxp_probe(struct platform_device *pdev)
        }
 
 err_out:
-       platform_set_drvdata(pdev, NULL);
-
        return ret;
 }
 
@@ -1016,7 +1014,6 @@ static int sccnxp_remove(struct platform_device *pdev)
                uart_remove_one_port(&s->uart, &s->port[i]);
 
        uart_unregister_driver(&s->uart);
-       platform_set_drvdata(pdev, NULL);
 
        if (!IS_ERR(s->regulator))
                return regulator_disable(s->regulator);
index 1fd564b8194b7affe59be4ae0d3b827829c7ba8a..67a0d1b8341c9a91e2f75bf22b796398bc552951 100644 (file)
@@ -717,7 +717,6 @@ port_err:
        clk_disable_unprepare(sirfport->clk);
        clk_put(sirfport->clk);
 clk_err:
-       platform_set_drvdata(pdev, NULL);
        if (sirfport->hw_flow_ctrl)
                pinctrl_put(sirfport->p);
 err:
@@ -728,7 +727,7 @@ static int sirfsoc_uart_remove(struct platform_device *pdev)
 {
        struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev);
        struct uart_port *port = &sirfport->port;
-       platform_set_drvdata(pdev, NULL);
+
        if (sirfport->hw_flow_ctrl)
                pinctrl_put(sirfport->p);
        clk_disable_unprepare(sirfport->clk);
index 48af43de34677d17343cc7e95b99f54cb5d821a9..a90bf0440b4ff8c42a4e6c57cb609beba2562a8b 100644 (file)
@@ -630,7 +630,6 @@ static int vt8500_serial_remove(struct platform_device *pdev)
 {
        struct vt8500_port *vt8500_port = platform_get_drvdata(pdev);
 
-       platform_set_drvdata(pdev, NULL);
        clk_disable_unprepare(vt8500_port->clk);
        uart_remove_one_port(&vt8500_uart_driver, &vt8500_port->uart);