diff options
Diffstat (limited to 'drivers/tty/serial/xilinx_uartps.c')
-rw-r--r-- | drivers/tty/serial/xilinx_uartps.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index b5f655d10098..6c9174530422 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c | |||
@@ -974,12 +974,11 @@ static int xuartps_probe(struct platform_device *pdev) | |||
974 | port->dev = &pdev->dev; | 974 | port->dev = &pdev->dev; |
975 | port->uartclk = clk_get_rate(clk); | 975 | port->uartclk = clk_get_rate(clk); |
976 | port->private_data = clk; | 976 | port->private_data = clk; |
977 | dev_set_drvdata(&pdev->dev, port); | 977 | platform_set_drvdata(pdev, port); |
978 | rc = uart_add_one_port(&xuartps_uart_driver, port); | 978 | rc = uart_add_one_port(&xuartps_uart_driver, port); |
979 | if (rc) { | 979 | if (rc) { |
980 | dev_err(&pdev->dev, | 980 | dev_err(&pdev->dev, |
981 | "uart_add_one_port() failed; err=%i\n", rc); | 981 | "uart_add_one_port() failed; err=%i\n", rc); |
982 | dev_set_drvdata(&pdev->dev, NULL); | ||
983 | return rc; | 982 | return rc; |
984 | } | 983 | } |
985 | return 0; | 984 | return 0; |
@@ -994,13 +993,12 @@ static int xuartps_probe(struct platform_device *pdev) | |||
994 | **/ | 993 | **/ |
995 | static int xuartps_remove(struct platform_device *pdev) | 994 | static int xuartps_remove(struct platform_device *pdev) |
996 | { | 995 | { |
997 | struct uart_port *port = dev_get_drvdata(&pdev->dev); | 996 | struct uart_port *port = platform_get_drvdata(pdev); |
998 | struct clk *clk = port->private_data; | 997 | struct clk *clk = port->private_data; |
999 | int rc; | 998 | int rc; |
1000 | 999 | ||
1001 | /* Remove the xuartps port from the serial core */ | 1000 | /* Remove the xuartps port from the serial core */ |
1002 | rc = uart_remove_one_port(&xuartps_uart_driver, port); | 1001 | rc = uart_remove_one_port(&xuartps_uart_driver, port); |
1003 | dev_set_drvdata(&pdev->dev, NULL); | ||
1004 | port->mapbase = 0; | 1002 | port->mapbase = 0; |
1005 | clk_disable_unprepare(clk); | 1003 | clk_disable_unprepare(clk); |
1006 | return rc; | 1004 | return rc; |