serial: sirfsoc: remove unnecessary platform_set_drvdata()
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.
Signed-off-by Jingoo Han <[email protected]>
--- drivers/tty/serial/sirfsoc_uart.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/tty/serial/sirfsoc_uart.c +1 -2
@@ -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
2013/5/7 Jingoo Han <[email protected]>
Quoted 7 lines
The driver core clears the driver data to NULL after
device_releaseor on probe failure, since commit0998d0631001288a5974afc0b2a5f568bcdecb4d(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 <[email protected]>
Acked-by Barry Song <[email protected]>
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@@ -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