Skip to contentSkip to conversation

serial: sirfsoc: remove unnecessary platform_set_drvdata()

PATCH Superseded Jingoo Han 2 participants 2 messages May 7, 2013 TTY layer and serial drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 13/15 serial: sirfsoc: 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.

---
 drivers/tty/serial/sirfsoc_uart.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/tty/serial/sirfsoc_uart.c +1 -2
index 03465b6..f256440 100644
@@ -716,7 +716,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:
@@ -727,7 +726,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);
Signature · 1 line
1.7.2.5
Acked-by on v1 13/15
#1 lore raw

2013/5/7 Jingoo Han <[email protected]>

Quoted 7 lines

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.

Quoted 30 lines
---
 drivers/tty/serial/sirfsoc_uart.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/tty/serial/sirfsoc_uart.c +1 -2
index 03465b6..f256440 100644
@@ -716,7 +716,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:
@@ -727,7 +726,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);

--
1.7.2.5