diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2018-02-01 17:17:29 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-02-12 12:04:16 +0000 |
commit | 721483e28889431426a15fe906f48aacd17f0999 (patch) | |
tree | 30788bc4452d4e8b020c96a5a40abde9a5038ab0 /drivers/spi/spi-dw.c | |
parent | 7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff) | |
download | linux-721483e28889431426a15fe906f48aacd17f0999.tar.bz2 |
spi: dw: Convert to generalized SPI controller API
Convert to generalized SPI controller API introduced by the
commit 8caab75fd2c2 ("spi: Generalize SPI "master" to "controller"").
Inside driver variable name "master" is still used to indicate the driver
is master only.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-dw.c')
-rw-r--r-- | drivers/spi/spi-dw.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 211cc7d75bf8..f693bfe95ab9 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -135,7 +135,7 @@ static inline void dw_spi_debugfs_remove(struct dw_spi *dws) static void dw_spi_set_cs(struct spi_device *spi, bool enable) { - struct dw_spi *dws = spi_master_get_devdata(spi->master); + struct dw_spi *dws = spi_controller_get_devdata(spi->controller); struct chip_data *chip = spi_get_ctldata(spi); /* Chip select logic is inverted from spi_set_cs() */ @@ -250,8 +250,8 @@ static irqreturn_t interrupt_transfer(struct dw_spi *dws) static irqreturn_t dw_spi_irq(int irq, void *dev_id) { - struct spi_master *master = dev_id; - struct dw_spi *dws = spi_master_get_devdata(master); + struct spi_controller *master = dev_id; + struct dw_spi *dws = spi_controller_get_devdata(master); u16 irq_status = dw_readl(dws, DW_SPI_ISR) & 0x3f; if (!irq_status) @@ -277,10 +277,10 @@ static int poll_transfer(struct dw_spi *dws) return 0; } -static int dw_spi_transfer_one(struct spi_master *master, +static int dw_spi_transfer_one(struct spi_controller *master, struct spi_device *spi, struct spi_transfer *transfer) { - struct dw_spi *dws = spi_master_get_devdata(master); + struct dw_spi *dws = spi_controller_get_devdata(master); struct chip_data *chip = spi_get_ctldata(spi); u8 imask = 0; u16 txlevel = 0; @@ -383,10 +383,10 @@ static int dw_spi_transfer_one(struct spi_master *master, return 1; } -static void dw_spi_handle_err(struct spi_master *master, +static void dw_spi_handle_err(struct spi_controller *master, struct spi_message *msg) { - struct dw_spi *dws = spi_master_get_devdata(master); + struct dw_spi *dws = spi_controller_get_devdata(master); if (dws->dma_mapped) dws->dma_ops->dma_stop(dws); @@ -471,7 +471,7 @@ static void spi_hw_init(struct device *dev, struct dw_spi *dws) int dw_spi_add_host(struct device *dev, struct dw_spi *dws) { - struct spi_master *master; + struct spi_controller *master; int ret; BUG_ON(dws == NULL); @@ -518,8 +518,8 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) } } - spi_master_set_devdata(master, dws); - ret = devm_spi_register_master(dev, master); + spi_controller_set_devdata(master, dws); + ret = devm_spi_register_controller(dev, master); if (ret) { dev_err(&master->dev, "problem registering spi master\n"); goto err_dma_exit; @@ -534,7 +534,7 @@ err_dma_exit: spi_enable_chip(dws, 0); free_irq(dws->irq, master); err_free_master: - spi_master_put(master); + spi_controller_put(master); return ret; } EXPORT_SYMBOL_GPL(dw_spi_add_host); @@ -556,7 +556,7 @@ int dw_spi_suspend_host(struct dw_spi *dws) { int ret; - ret = spi_master_suspend(dws->master); + ret = spi_controller_suspend(dws->master); if (ret) return ret; @@ -570,7 +570,7 @@ int dw_spi_resume_host(struct dw_spi *dws) int ret; spi_hw_init(&dws->master->dev, dws); - ret = spi_master_resume(dws->master); + ret = spi_controller_resume(dws->master); if (ret) dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret); return ret; |