spi: cadence-xspi: switch to use modern name
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20230728093221.3312026-12-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Родитель
5a59b9a107
Коммит
ec7cfadff2
|
@ -419,7 +419,7 @@ static int cdns_xspi_mem_op_execute(struct spi_mem *mem,
|
|||
const struct spi_mem_op *op)
|
||||
{
|
||||
struct cdns_xspi_dev *cdns_xspi =
|
||||
spi_master_get_devdata(mem->spi->master);
|
||||
spi_controller_get_devdata(mem->spi->controller);
|
||||
int ret = 0;
|
||||
|
||||
ret = cdns_xspi_mem_op(cdns_xspi, mem, op);
|
||||
|
@ -430,7 +430,7 @@ static int cdns_xspi_mem_op_execute(struct spi_mem *mem,
|
|||
static int cdns_xspi_adjust_mem_op_size(struct spi_mem *mem, struct spi_mem_op *op)
|
||||
{
|
||||
struct cdns_xspi_dev *cdns_xspi =
|
||||
spi_master_get_devdata(mem->spi->master);
|
||||
spi_controller_get_devdata(mem->spi->controller);
|
||||
|
||||
op->data.nbytes = clamp_val(op->data.nbytes, 0, cdns_xspi->sdmasize);
|
||||
|
||||
|
@ -527,26 +527,26 @@ static void cdns_xspi_print_phy_config(struct cdns_xspi_dev *cdns_xspi)
|
|||
static int cdns_xspi_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct spi_master *master = NULL;
|
||||
struct spi_controller *host = NULL;
|
||||
struct cdns_xspi_dev *cdns_xspi = NULL;
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
master = devm_spi_alloc_master(dev, sizeof(*cdns_xspi));
|
||||
if (!master)
|
||||
host = devm_spi_alloc_host(dev, sizeof(*cdns_xspi));
|
||||
if (!host)
|
||||
return -ENOMEM;
|
||||
|
||||
master->mode_bits = SPI_3WIRE | SPI_TX_DUAL | SPI_TX_QUAD |
|
||||
host->mode_bits = SPI_3WIRE | SPI_TX_DUAL | SPI_TX_QUAD |
|
||||
SPI_RX_DUAL | SPI_RX_QUAD | SPI_TX_OCTAL | SPI_RX_OCTAL |
|
||||
SPI_MODE_0 | SPI_MODE_3;
|
||||
|
||||
master->mem_ops = &cadence_xspi_mem_ops;
|
||||
master->dev.of_node = pdev->dev.of_node;
|
||||
master->bus_num = -1;
|
||||
host->mem_ops = &cadence_xspi_mem_ops;
|
||||
host->dev.of_node = pdev->dev.of_node;
|
||||
host->bus_num = -1;
|
||||
|
||||
platform_set_drvdata(pdev, master);
|
||||
platform_set_drvdata(pdev, host);
|
||||
|
||||
cdns_xspi = spi_master_get_devdata(master);
|
||||
cdns_xspi = spi_controller_get_devdata(host);
|
||||
cdns_xspi->pdev = pdev;
|
||||
cdns_xspi->dev = &pdev->dev;
|
||||
cdns_xspi->cur_cs = 0;
|
||||
|
@ -596,15 +596,15 @@ static int cdns_xspi_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
master->num_chipselect = 1 << cdns_xspi->hw_num_banks;
|
||||
host->num_chipselect = 1 << cdns_xspi->hw_num_banks;
|
||||
|
||||
ret = devm_spi_register_master(dev, master);
|
||||
ret = devm_spi_register_controller(dev, host);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to register SPI master\n");
|
||||
dev_err(dev, "Failed to register SPI host\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
dev_info(dev, "Successfully registered SPI master\n");
|
||||
dev_info(dev, "Successfully registered SPI host\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче