diff options
-rw-r--r-- | drivers/spi/spi-rspi.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 92bec7e91046..1fb0ad213324 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/dmaengine.h> | 33 | #include <linux/dmaengine.h> |
34 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
35 | #include <linux/of_device.h> | 35 | #include <linux/of_device.h> |
36 | #include <linux/pm_runtime.h> | ||
36 | #include <linux/sh_dma.h> | 37 | #include <linux/sh_dma.h> |
37 | #include <linux/spi/spi.h> | 38 | #include <linux/spi/spi.h> |
38 | #include <linux/spi/rspi.h> | 39 | #include <linux/spi/rspi.h> |
@@ -1111,7 +1112,7 @@ static int rspi_remove(struct platform_device *pdev) | |||
1111 | struct rspi_data *rspi = platform_get_drvdata(pdev); | 1112 | struct rspi_data *rspi = platform_get_drvdata(pdev); |
1112 | 1113 | ||
1113 | rspi_release_dma(rspi); | 1114 | rspi_release_dma(rspi); |
1114 | clk_disable_unprepare(rspi->clk); | 1115 | pm_runtime_disable(&pdev->dev); |
1115 | 1116 | ||
1116 | return 0; | 1117 | return 0; |
1117 | } | 1118 | } |
@@ -1242,16 +1243,13 @@ static int rspi_probe(struct platform_device *pdev) | |||
1242 | goto error1; | 1243 | goto error1; |
1243 | } | 1244 | } |
1244 | 1245 | ||
1245 | ret = clk_prepare_enable(rspi->clk); | 1246 | pm_runtime_enable(&pdev->dev); |
1246 | if (ret < 0) { | ||
1247 | dev_err(&pdev->dev, "unable to prepare/enable clock\n"); | ||
1248 | goto error1; | ||
1249 | } | ||
1250 | 1247 | ||
1251 | init_waitqueue_head(&rspi->wait); | 1248 | init_waitqueue_head(&rspi->wait); |
1252 | 1249 | ||
1253 | master->bus_num = pdev->id; | 1250 | master->bus_num = pdev->id; |
1254 | master->setup = rspi_setup; | 1251 | master->setup = rspi_setup; |
1252 | master->auto_runtime_pm = true; | ||
1255 | master->transfer_one = ops->transfer_one; | 1253 | master->transfer_one = ops->transfer_one; |
1256 | master->prepare_message = rspi_prepare_message; | 1254 | master->prepare_message = rspi_prepare_message; |
1257 | master->unprepare_message = rspi_unprepare_message; | 1255 | master->unprepare_message = rspi_unprepare_message; |
@@ -1312,7 +1310,7 @@ static int rspi_probe(struct platform_device *pdev) | |||
1312 | error3: | 1310 | error3: |
1313 | rspi_release_dma(rspi); | 1311 | rspi_release_dma(rspi); |
1314 | error2: | 1312 | error2: |
1315 | clk_disable_unprepare(rspi->clk); | 1313 | pm_runtime_disable(&pdev->dev); |
1316 | error1: | 1314 | error1: |
1317 | spi_master_put(master); | 1315 | spi_master_put(master); |
1318 | 1316 | ||