diff options
Diffstat (limited to 'drivers/spi/spi-sirf.c')
-rw-r--r-- | drivers/spi/spi-sirf.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index ecc3d9763d10..f59d4177b419 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c @@ -382,8 +382,7 @@ spi_sirfsoc_setup_transfer(struct spi_device *spi, struct spi_transfer *t) sspi = spi_master_get_devdata(spi->master); - bits_per_word = t && t->bits_per_word ? t->bits_per_word : - spi->bits_per_word; + bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word; hz = t && t->speed_hz ? t->speed_hz : spi->max_speed_hz; /* Enable IO mode for RX, TX */ @@ -479,7 +478,7 @@ static int spi_sirfsoc_setup(struct spi_device *spi) return spi_sirfsoc_setup_transfer(spi, NULL); } -static int __devinit spi_sirfsoc_probe(struct platform_device *pdev) +static int spi_sirfsoc_probe(struct platform_device *pdev) { struct sirfsoc_spi *sspi; struct spi_master *master; @@ -535,10 +534,9 @@ static int __devinit spi_sirfsoc_probe(struct platform_device *pdev) } } - sspi->base = devm_request_and_ioremap(&pdev->dev, mem_res); - if (!sspi->base) { - dev_err(&pdev->dev, "IO remap failed!\n"); - ret = -ENOMEM; + sspi->base = devm_ioremap_resource(&pdev->dev, mem_res); + if (IS_ERR(sspi->base)) { + ret = PTR_ERR(sspi->base); goto free_master; } @@ -570,7 +568,7 @@ static int __devinit spi_sirfsoc_probe(struct platform_device *pdev) ret = -EINVAL; goto free_pin; } - clk_enable(sspi->clk); + clk_prepare_enable(sspi->clk); sspi->ctrl_freq = clk_get_rate(sspi->clk); init_completion(&sspi->done); @@ -594,7 +592,7 @@ static int __devinit spi_sirfsoc_probe(struct platform_device *pdev) return 0; free_clk: - clk_disable(sspi->clk); + clk_disable_unprepare(sspi->clk); clk_put(sspi->clk); free_pin: pinctrl_put(sspi->p); @@ -604,7 +602,7 @@ err_cs: return ret; } -static int __devexit spi_sirfsoc_remove(struct platform_device *pdev) +static int spi_sirfsoc_remove(struct platform_device *pdev) { struct spi_master *master; struct sirfsoc_spi *sspi; @@ -618,7 +616,7 @@ static int __devexit spi_sirfsoc_remove(struct platform_device *pdev) if (sspi->chipselect[i] > 0) gpio_free(sspi->chipselect[i]); } - clk_disable(sspi->clk); + clk_disable_unprepare(sspi->clk); clk_put(sspi->clk); pinctrl_put(sspi->p); spi_master_put(master); @@ -659,6 +657,7 @@ static const struct dev_pm_ops spi_sirfsoc_pm_ops = { static const struct of_device_id spi_sirfsoc_of_match[] = { { .compatible = "sirf,prima2-spi", }, + { .compatible = "sirf,marco-spi", }, {} }; MODULE_DEVICE_TABLE(of, sirfsoc_spi_of_match); @@ -673,7 +672,7 @@ static struct platform_driver spi_sirfsoc_driver = { .of_match_table = spi_sirfsoc_of_match, }, .probe = spi_sirfsoc_probe, - .remove = __devexit_p(spi_sirfsoc_remove), + .remove = spi_sirfsoc_remove, }; module_platform_driver(spi_sirfsoc_driver); |