Commit 43b829b3 authored by Jingoo Han's avatar Jingoo Han Committed by Greg Kroah-Hartman

serial: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d063
(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: default avatarJingoo Han <jg1.han@samsung.com>
Acked-by: default avatarBarry Song <baohua.song@csr.com>
Acked-by: default avatarTony Prisk <linux@prisktech.co.nz>
Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 74b3b4cd
...@@ -703,7 +703,6 @@ static int ar933x_uart_remove(struct platform_device *pdev) ...@@ -703,7 +703,6 @@ static int ar933x_uart_remove(struct platform_device *pdev)
struct ar933x_uart_port *up; struct ar933x_uart_port *up;
up = platform_get_drvdata(pdev); up = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
if (up) { if (up) {
uart_remove_one_port(&ar933x_uart_driver, &up->port); uart_remove_one_port(&ar933x_uart_driver, &up->port);
......
...@@ -1860,7 +1860,6 @@ static int atmel_serial_remove(struct platform_device *pdev) ...@@ -1860,7 +1860,6 @@ static int atmel_serial_remove(struct platform_device *pdev)
int ret = 0; int ret = 0;
device_init_wakeup(&pdev->dev, 0); device_init_wakeup(&pdev->dev, 0);
platform_set_drvdata(pdev, NULL);
ret = uart_remove_one_port(&atmel_uart, port); ret = uart_remove_one_port(&atmel_uart, port);
......
...@@ -852,7 +852,6 @@ static int bcm_uart_remove(struct platform_device *pdev) ...@@ -852,7 +852,6 @@ static int bcm_uart_remove(struct platform_device *pdev)
port = platform_get_drvdata(pdev); port = platform_get_drvdata(pdev);
uart_remove_one_port(&bcm_uart_driver, port); uart_remove_one_port(&bcm_uart_driver, port);
platform_set_drvdata(pdev, NULL);
/* mark port as free */ /* mark port as free */
ports[pdev->id].membase = 0; ports[pdev->id].membase = 0;
return 0; return 0;
......
...@@ -438,8 +438,7 @@ static int uart_clps711x_probe(struct platform_device *pdev) ...@@ -438,8 +438,7 @@ static int uart_clps711x_probe(struct platform_device *pdev)
s->uart_clk = devm_clk_get(&pdev->dev, "uart"); s->uart_clk = devm_clk_get(&pdev->dev, "uart");
if (IS_ERR(s->uart_clk)) { if (IS_ERR(s->uart_clk)) {
dev_err(&pdev->dev, "Can't get UART clocks\n"); dev_err(&pdev->dev, "Can't get UART clocks\n");
ret = PTR_ERR(s->uart_clk); return PTR_ERR(s->uart_clk);
goto err_out;
} }
s->uart.owner = THIS_MODULE; s->uart.owner = THIS_MODULE;
...@@ -461,7 +460,7 @@ static int uart_clps711x_probe(struct platform_device *pdev) ...@@ -461,7 +460,7 @@ static int uart_clps711x_probe(struct platform_device *pdev)
if (ret) { if (ret) {
dev_err(&pdev->dev, "Registering UART driver failed\n"); dev_err(&pdev->dev, "Registering UART driver failed\n");
devm_clk_put(&pdev->dev, s->uart_clk); devm_clk_put(&pdev->dev, s->uart_clk);
goto err_out; return ret;
} }
for (i = 0; i < UART_CLPS711X_NR; i++) { for (i = 0; i < UART_CLPS711X_NR; i++) {
...@@ -478,11 +477,6 @@ static int uart_clps711x_probe(struct platform_device *pdev) ...@@ -478,11 +477,6 @@ static int uart_clps711x_probe(struct platform_device *pdev)
} }
return 0; return 0;
err_out:
platform_set_drvdata(pdev, NULL);
return ret;
} }
static int uart_clps711x_remove(struct platform_device *pdev) static int uart_clps711x_remove(struct platform_device *pdev)
...@@ -495,7 +489,6 @@ 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); devm_clk_put(&pdev->dev, s->uart_clk);
uart_unregister_driver(&s->uart); uart_unregister_driver(&s->uart);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -778,8 +778,6 @@ static int efm32_uart_remove(struct platform_device *pdev) ...@@ -778,8 +778,6 @@ static int efm32_uart_remove(struct platform_device *pdev)
{ {
struct efm32_uart_port *efm_port = platform_get_drvdata(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); uart_remove_one_port(&efm32_uart_reg, &efm_port->port);
if (pdev->id >= 0 && pdev->id < ARRAY_SIZE(efm32_uart_ports)) if (pdev->id >= 0 && pdev->id < ARRAY_SIZE(efm32_uart_ports))
......
...@@ -1596,8 +1596,6 @@ static int serial_imx_remove(struct platform_device *pdev) ...@@ -1596,8 +1596,6 @@ static int serial_imx_remove(struct platform_device *pdev)
pdata = pdev->dev.platform_data; pdata = pdev->dev.platform_data;
platform_set_drvdata(pdev, NULL);
uart_remove_one_port(&imx_reg, &sport->port); uart_remove_one_port(&imx_reg, &sport->port);
if (pdata && pdata->exit) if (pdata && pdata->exit)
......
...@@ -693,8 +693,6 @@ static int serial_netx_remove(struct platform_device *pdev) ...@@ -693,8 +693,6 @@ static int serial_netx_remove(struct platform_device *pdev)
{ {
struct netx_port *sport = platform_get_drvdata(pdev); struct netx_port *sport = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
if (sport) if (sport)
uart_remove_one_port(&netx_reg, &sport->port); uart_remove_one_port(&netx_reg, &sport->port);
......
...@@ -1798,7 +1798,6 @@ static int __exit pmz_detach(struct platform_device *pdev) ...@@ -1798,7 +1798,6 @@ static int __exit pmz_detach(struct platform_device *pdev)
uart_remove_one_port(&pmz_uart_reg, &uap->port); uart_remove_one_port(&pmz_uart_reg, &uap->port);
platform_set_drvdata(pdev, NULL);
uap->port.dev = NULL; uap->port.dev = NULL;
return 0; return 0;
......
...@@ -801,8 +801,6 @@ static int pnx8xxx_serial_remove(struct platform_device *pdev) ...@@ -801,8 +801,6 @@ static int pnx8xxx_serial_remove(struct platform_device *pdev)
{ {
struct pnx8xxx_port *sport = platform_get_drvdata(pdev); struct pnx8xxx_port *sport = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
if (sport) if (sport)
uart_remove_one_port(&pnx8xxx_reg, &sport->port); uart_remove_one_port(&pnx8xxx_reg, &sport->port);
......
...@@ -945,8 +945,6 @@ static int serial_pxa_remove(struct platform_device *dev) ...@@ -945,8 +945,6 @@ static int serial_pxa_remove(struct platform_device *dev)
{ {
struct uart_pxa_port *sport = platform_get_drvdata(dev); struct uart_pxa_port *sport = platform_get_drvdata(dev);
platform_set_drvdata(dev, NULL);
uart_remove_one_port(&serial_pxa_reg, &sport->port); uart_remove_one_port(&serial_pxa_reg, &sport->port);
clk_unprepare(sport->clk); clk_unprepare(sport->clk);
......
...@@ -864,8 +864,6 @@ static int sa1100_serial_remove(struct platform_device *pdev) ...@@ -864,8 +864,6 @@ static int sa1100_serial_remove(struct platform_device *pdev)
{ {
struct sa1100_port *sport = platform_get_drvdata(pdev); struct sa1100_port *sport = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
if (sport) if (sport)
uart_remove_one_port(&sa1100_reg, &sport->port); uart_remove_one_port(&sa1100_reg, &sport->port);
......
...@@ -997,8 +997,6 @@ static int sccnxp_probe(struct platform_device *pdev) ...@@ -997,8 +997,6 @@ static int sccnxp_probe(struct platform_device *pdev)
} }
err_out: err_out:
platform_set_drvdata(pdev, NULL);
return ret; return ret;
} }
...@@ -1016,7 +1014,6 @@ static int sccnxp_remove(struct platform_device *pdev) ...@@ -1016,7 +1014,6 @@ static int sccnxp_remove(struct platform_device *pdev)
uart_remove_one_port(&s->uart, &s->port[i]); uart_remove_one_port(&s->uart, &s->port[i]);
uart_unregister_driver(&s->uart); uart_unregister_driver(&s->uart);
platform_set_drvdata(pdev, NULL);
if (!IS_ERR(s->regulator)) if (!IS_ERR(s->regulator))
return regulator_disable(s->regulator); return regulator_disable(s->regulator);
......
...@@ -717,7 +717,6 @@ int sirfsoc_uart_probe(struct platform_device *pdev) ...@@ -717,7 +717,6 @@ int sirfsoc_uart_probe(struct platform_device *pdev)
clk_disable_unprepare(sirfport->clk); clk_disable_unprepare(sirfport->clk);
clk_put(sirfport->clk); clk_put(sirfport->clk);
clk_err: clk_err:
platform_set_drvdata(pdev, NULL);
if (sirfport->hw_flow_ctrl) if (sirfport->hw_flow_ctrl)
pinctrl_put(sirfport->p); pinctrl_put(sirfport->p);
err: err:
...@@ -728,7 +727,7 @@ static int sirfsoc_uart_remove(struct platform_device *pdev) ...@@ -728,7 +727,7 @@ static int sirfsoc_uart_remove(struct platform_device *pdev)
{ {
struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev); struct sirfsoc_uart_port *sirfport = platform_get_drvdata(pdev);
struct uart_port *port = &sirfport->port; struct uart_port *port = &sirfport->port;
platform_set_drvdata(pdev, NULL);
if (sirfport->hw_flow_ctrl) if (sirfport->hw_flow_ctrl)
pinctrl_put(sirfport->p); pinctrl_put(sirfport->p);
clk_disable_unprepare(sirfport->clk); clk_disable_unprepare(sirfport->clk);
......
...@@ -630,7 +630,6 @@ static int vt8500_serial_remove(struct platform_device *pdev) ...@@ -630,7 +630,6 @@ static int vt8500_serial_remove(struct platform_device *pdev)
{ {
struct vt8500_port *vt8500_port = platform_get_drvdata(pdev); struct vt8500_port *vt8500_port = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
clk_disable_unprepare(vt8500_port->clk); clk_disable_unprepare(vt8500_port->clk);
uart_remove_one_port(&vt8500_uart_driver, &vt8500_port->uart); uart_remove_one_port(&vt8500_uart_driver, &vt8500_port->uart);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment