diff options
author | Scott Jiang <scott.jiang.linux@gmail.com> | 2014-04-05 11:29:09 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-14 17:45:25 +0100 |
commit | c34cc2487d5e6c225609696db3f49d40259787e2 (patch) | |
tree | afbbcacc5f20ac2aab6e4d71df986ea01f4dde2c /drivers/spi/spi-adi-v3.c | |
parent | 766e3721990d2c78e0d614b57753f105adbaa8c5 (diff) | |
download | blackbird-op-linux-c34cc2487d5e6c225609696db3f49d40259787e2.tar.gz blackbird-op-linux-c34cc2487d5e6c225609696db3f49d40259787e2.zip |
spi: spi-adi-v3: convert to use common clk framework
Use common clk api to get spi clock.
Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-adi-v3.c')
-rw-r--r-- | drivers/spi/spi-adi-v3.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/spi/spi-adi-v3.c b/drivers/spi/spi-adi-v3.c index 0c2914cfcdb5..dcb2287c7f8a 100644 --- a/drivers/spi/spi-adi-v3.c +++ b/drivers/spi/spi-adi-v3.c @@ -13,6 +13,7 @@ * GNU General Public License for more details. */ +#include <linux/clk.h> #include <linux/delay.h> #include <linux/device.h> #include <linux/dma-mapping.h> @@ -800,7 +801,7 @@ static int adi_spi_probe(struct platform_device *pdev) struct adi_spi_master *drv_data; struct resource *mem, *res; unsigned int tx_dma, rx_dma; - unsigned long sclk; + struct clk *sclk; int ret; if (!info) { @@ -808,10 +809,10 @@ static int adi_spi_probe(struct platform_device *pdev) return -ENODEV; } - sclk = get_sclk1(); - if (!sclk) { - dev_err(dev, "can not get sclk1\n"); - return -ENXIO; + sclk = devm_clk_get(dev, "spi"); + if (IS_ERR(sclk)) { + dev_err(dev, "can not get spi clock\n"); + return PTR_ERR(sclk); } res = platform_get_resource(pdev, IORESOURCE_DMA, 0); @@ -852,7 +853,7 @@ static int adi_spi_probe(struct platform_device *pdev) drv_data->tx_dma = tx_dma; drv_data->rx_dma = rx_dma; drv_data->pin_req = info->pin_req; - drv_data->sclk = sclk; + drv_data->sclk = clk_get_rate(sclk); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); drv_data->regs = devm_ioremap_resource(dev, mem); |