mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-03 19:55:31 +00:00
spi: falcon: 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/20230807124105.3429709-5-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
24e9b75c0c
commit
45d9591105
@ -91,14 +91,14 @@
|
|||||||
|
|
||||||
struct falcon_sflash {
|
struct falcon_sflash {
|
||||||
u32 sfcmd; /* for caching of opcode, direction, ... */
|
u32 sfcmd; /* for caching of opcode, direction, ... */
|
||||||
struct spi_master *master;
|
struct spi_controller *host;
|
||||||
};
|
};
|
||||||
|
|
||||||
int falcon_sflash_xfer(struct spi_device *spi, struct spi_transfer *t,
|
int falcon_sflash_xfer(struct spi_device *spi, struct spi_transfer *t,
|
||||||
unsigned long flags)
|
unsigned long flags)
|
||||||
{
|
{
|
||||||
struct device *dev = &spi->dev;
|
struct device *dev = &spi->dev;
|
||||||
struct falcon_sflash *priv = spi_master_get_devdata(spi->master);
|
struct falcon_sflash *priv = spi_controller_get_devdata(spi->controller);
|
||||||
const u8 *txp = t->tx_buf;
|
const u8 *txp = t->tx_buf;
|
||||||
u8 *rxp = t->rx_buf;
|
u8 *rxp = t->rx_buf;
|
||||||
unsigned int bytelen = ((8 * t->len + 7) / 8);
|
unsigned int bytelen = ((8 * t->len + 7) / 8);
|
||||||
@ -351,10 +351,10 @@ static int falcon_sflash_setup(struct spi_device *spi)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int falcon_sflash_xfer_one(struct spi_master *master,
|
static int falcon_sflash_xfer_one(struct spi_controller *host,
|
||||||
struct spi_message *m)
|
struct spi_message *m)
|
||||||
{
|
{
|
||||||
struct falcon_sflash *priv = spi_master_get_devdata(master);
|
struct falcon_sflash *priv = spi_controller_get_devdata(host);
|
||||||
struct spi_transfer *t;
|
struct spi_transfer *t;
|
||||||
unsigned long spi_flags;
|
unsigned long spi_flags;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
@ -382,7 +382,7 @@ static int falcon_sflash_xfer_one(struct spi_master *master,
|
|||||||
}
|
}
|
||||||
|
|
||||||
m->status = ret;
|
m->status = ret;
|
||||||
spi_finalize_current_message(master);
|
spi_finalize_current_message(host);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -390,25 +390,25 @@ static int falcon_sflash_xfer_one(struct spi_master *master,
|
|||||||
static int falcon_sflash_probe(struct platform_device *pdev)
|
static int falcon_sflash_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct falcon_sflash *priv;
|
struct falcon_sflash *priv;
|
||||||
struct spi_master *master;
|
struct spi_controller *host;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
master = spi_alloc_master(&pdev->dev, sizeof(*priv));
|
host = spi_alloc_host(&pdev->dev, sizeof(*priv));
|
||||||
if (!master)
|
if (!host)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
priv = spi_master_get_devdata(master);
|
priv = spi_controller_get_devdata(host);
|
||||||
priv->master = master;
|
priv->host = host;
|
||||||
|
|
||||||
master->mode_bits = SPI_MODE_3;
|
host->mode_bits = SPI_MODE_3;
|
||||||
master->flags = SPI_CONTROLLER_HALF_DUPLEX;
|
host->flags = SPI_CONTROLLER_HALF_DUPLEX;
|
||||||
master->setup = falcon_sflash_setup;
|
host->setup = falcon_sflash_setup;
|
||||||
master->transfer_one_message = falcon_sflash_xfer_one;
|
host->transfer_one_message = falcon_sflash_xfer_one;
|
||||||
master->dev.of_node = pdev->dev.of_node;
|
host->dev.of_node = pdev->dev.of_node;
|
||||||
|
|
||||||
ret = devm_spi_register_master(&pdev->dev, master);
|
ret = devm_spi_register_controller(&pdev->dev, host);
|
||||||
if (ret)
|
if (ret)
|
||||||
spi_master_put(master);
|
spi_controller_put(host);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user