diff options
| -rw-r--r-- | drivers/tty/serial/xilinx_uartps.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 7e4150aa69c6..103ba8826d06 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c | |||
| @@ -953,23 +953,23 @@ static int xuartps_probe(struct platform_device *pdev) | |||
| 953 | if (!xuartps_data) | 953 | if (!xuartps_data) |
| 954 | return -ENOMEM; | 954 | return -ENOMEM; |
| 955 | 955 | ||
| 956 | xuartps_data->aperclk = clk_get(&pdev->dev, "aper_clk"); | 956 | xuartps_data->aperclk = devm_clk_get(&pdev->dev, "aper_clk"); |
| 957 | if (IS_ERR(xuartps_data->aperclk)) { | 957 | if (IS_ERR(xuartps_data->aperclk)) { |
| 958 | dev_err(&pdev->dev, "aper_clk clock not found.\n"); | 958 | dev_err(&pdev->dev, "aper_clk clock not found.\n"); |
| 959 | rc = PTR_ERR(xuartps_data->aperclk); | 959 | rc = PTR_ERR(xuartps_data->aperclk); |
| 960 | goto err_out_free; | 960 | goto err_out_free; |
| 961 | } | 961 | } |
| 962 | xuartps_data->refclk = clk_get(&pdev->dev, "ref_clk"); | 962 | xuartps_data->refclk = devm_clk_get(&pdev->dev, "ref_clk"); |
| 963 | if (IS_ERR(xuartps_data->refclk)) { | 963 | if (IS_ERR(xuartps_data->refclk)) { |
| 964 | dev_err(&pdev->dev, "ref_clk clock not found.\n"); | 964 | dev_err(&pdev->dev, "ref_clk clock not found.\n"); |
| 965 | rc = PTR_ERR(xuartps_data->refclk); | 965 | rc = PTR_ERR(xuartps_data->refclk); |
| 966 | goto err_out_clk_put_aper; | 966 | goto err_out_free; |
| 967 | } | 967 | } |
| 968 | 968 | ||
| 969 | rc = clk_prepare_enable(xuartps_data->aperclk); | 969 | rc = clk_prepare_enable(xuartps_data->aperclk); |
| 970 | if (rc) { | 970 | if (rc) { |
| 971 | dev_err(&pdev->dev, "Unable to enable APER clock.\n"); | 971 | dev_err(&pdev->dev, "Unable to enable APER clock.\n"); |
| 972 | goto err_out_clk_put; | 972 | goto err_out_free; |
| 973 | } | 973 | } |
| 974 | rc = clk_prepare_enable(xuartps_data->refclk); | 974 | rc = clk_prepare_enable(xuartps_data->refclk); |
| 975 | if (rc) { | 975 | if (rc) { |
| @@ -1020,10 +1020,6 @@ err_out_clk_disable: | |||
| 1020 | clk_disable_unprepare(xuartps_data->refclk); | 1020 | clk_disable_unprepare(xuartps_data->refclk); |
| 1021 | err_out_clk_dis_aper: | 1021 | err_out_clk_dis_aper: |
| 1022 | clk_disable_unprepare(xuartps_data->aperclk); | 1022 | clk_disable_unprepare(xuartps_data->aperclk); |
| 1023 | err_out_clk_put: | ||
| 1024 | clk_put(xuartps_data->refclk); | ||
| 1025 | err_out_clk_put_aper: | ||
| 1026 | clk_put(xuartps_data->aperclk); | ||
| 1027 | err_out_free: | 1023 | err_out_free: |
| 1028 | kfree(xuartps_data); | 1024 | kfree(xuartps_data); |
| 1029 | 1025 | ||
| @@ -1047,8 +1043,6 @@ static int xuartps_remove(struct platform_device *pdev) | |||
| 1047 | port->mapbase = 0; | 1043 | port->mapbase = 0; |
| 1048 | clk_disable_unprepare(xuartps_data->refclk); | 1044 | clk_disable_unprepare(xuartps_data->refclk); |
| 1049 | clk_disable_unprepare(xuartps_data->aperclk); | 1045 | clk_disable_unprepare(xuartps_data->aperclk); |
| 1050 | clk_put(xuartps_data->refclk); | ||
| 1051 | clk_put(xuartps_data->aperclk); | ||
| 1052 | kfree(xuartps_data); | 1046 | kfree(xuartps_data); |
| 1053 | return rc; | 1047 | return rc; |
| 1054 | } | 1048 | } |
