Commit 556aca5b authored by Yang Yingliang's avatar Yang Yingliang Committed by Mark Brown

spi: spi-cavium-thunderx: switch to use modern name

Change legacy name master to modern name host or controller.

No functional changed.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-16-yangyingliang@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d2a44ae8
...@@ -20,15 +20,15 @@ static int thunderx_spi_probe(struct pci_dev *pdev, ...@@ -20,15 +20,15 @@ static int thunderx_spi_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct spi_master *master; struct spi_controller *host;
struct octeon_spi *p; struct octeon_spi *p;
int ret; int ret;
master = spi_alloc_master(dev, sizeof(struct octeon_spi)); host = spi_alloc_host(dev, sizeof(struct octeon_spi));
if (!master) if (!host)
return -ENOMEM; return -ENOMEM;
p = spi_master_get_devdata(master); p = spi_controller_get_devdata(host);
ret = pcim_enable_device(pdev); ret = pcim_enable_device(pdev);
if (ret) if (ret)
...@@ -64,18 +64,18 @@ static int thunderx_spi_probe(struct pci_dev *pdev, ...@@ -64,18 +64,18 @@ static int thunderx_spi_probe(struct pci_dev *pdev,
p->sys_freq = SYS_FREQ_DEFAULT; p->sys_freq = SYS_FREQ_DEFAULT;
dev_info(dev, "Set system clock to %u\n", p->sys_freq); dev_info(dev, "Set system clock to %u\n", p->sys_freq);
master->flags = SPI_CONTROLLER_HALF_DUPLEX; host->flags = SPI_CONTROLLER_HALF_DUPLEX;
master->num_chipselect = 4; host->num_chipselect = 4;
master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH | host->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH |
SPI_LSB_FIRST | SPI_3WIRE; SPI_LSB_FIRST | SPI_3WIRE;
master->transfer_one_message = octeon_spi_transfer_one_message; host->transfer_one_message = octeon_spi_transfer_one_message;
master->bits_per_word_mask = SPI_BPW_MASK(8); host->bits_per_word_mask = SPI_BPW_MASK(8);
master->max_speed_hz = OCTEON_SPI_MAX_CLOCK_HZ; host->max_speed_hz = OCTEON_SPI_MAX_CLOCK_HZ;
master->dev.of_node = pdev->dev.of_node; host->dev.of_node = pdev->dev.of_node;
pci_set_drvdata(pdev, master); pci_set_drvdata(pdev, host);
ret = devm_spi_register_master(dev, master); ret = devm_spi_register_controller(dev, host);
if (ret) if (ret)
goto error; goto error;
...@@ -84,16 +84,16 @@ static int thunderx_spi_probe(struct pci_dev *pdev, ...@@ -84,16 +84,16 @@ static int thunderx_spi_probe(struct pci_dev *pdev,
error: error:
clk_disable_unprepare(p->clk); clk_disable_unprepare(p->clk);
pci_release_regions(pdev); pci_release_regions(pdev);
spi_master_put(master); spi_controller_put(host);
return ret; return ret;
} }
static void thunderx_spi_remove(struct pci_dev *pdev) static void thunderx_spi_remove(struct pci_dev *pdev)
{ {
struct spi_master *master = pci_get_drvdata(pdev); struct spi_controller *host = pci_get_drvdata(pdev);
struct octeon_spi *p; struct octeon_spi *p;
p = spi_master_get_devdata(master); p = spi_controller_get_devdata(host);
if (!p) if (!p)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment