mirror of
https://github.com/torvalds/linux.git
synced 2024-11-12 23:23:03 +00:00
spi: octeon: 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-15-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
1baba77b1f
commit
d2a44ae8d2
@ -19,15 +19,15 @@
|
|||||||
static int octeon_spi_probe(struct platform_device *pdev)
|
static int octeon_spi_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
void __iomem *reg_base;
|
void __iomem *reg_base;
|
||||||
struct spi_master *master;
|
struct spi_controller *host;
|
||||||
struct octeon_spi *p;
|
struct octeon_spi *p;
|
||||||
int err = -ENOENT;
|
int err = -ENOENT;
|
||||||
|
|
||||||
master = spi_alloc_master(&pdev->dev, sizeof(struct octeon_spi));
|
host = spi_alloc_host(&pdev->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);
|
||||||
platform_set_drvdata(pdev, master);
|
platform_set_drvdata(pdev, host);
|
||||||
|
|
||||||
reg_base = devm_platform_ioremap_resource(pdev, 0);
|
reg_base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (IS_ERR(reg_base)) {
|
if (IS_ERR(reg_base)) {
|
||||||
@ -43,21 +43,21 @@ static int octeon_spi_probe(struct platform_device *pdev)
|
|||||||
p->regs.tx = 0x10;
|
p->regs.tx = 0x10;
|
||||||
p->regs.data = 0x80;
|
p->regs.data = 0x80;
|
||||||
|
|
||||||
master->num_chipselect = 4;
|
host->num_chipselect = 4;
|
||||||
master->mode_bits = SPI_CPHA |
|
host->mode_bits = SPI_CPHA |
|
||||||
SPI_CPOL |
|
SPI_CPOL |
|
||||||
SPI_CS_HIGH |
|
SPI_CS_HIGH |
|
||||||
SPI_LSB_FIRST |
|
SPI_LSB_FIRST |
|
||||||
SPI_3WIRE;
|
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;
|
||||||
err = devm_spi_register_master(&pdev->dev, master);
|
err = devm_spi_register_controller(&pdev->dev, host);
|
||||||
if (err) {
|
if (err) {
|
||||||
dev_err(&pdev->dev, "register master failed: %d\n", err);
|
dev_err(&pdev->dev, "register host failed: %d\n", err);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,14 +65,14 @@ static int octeon_spi_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
spi_master_put(master);
|
spi_controller_put(host);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void octeon_spi_remove(struct platform_device *pdev)
|
static void octeon_spi_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct spi_master *master = platform_get_drvdata(pdev);
|
struct spi_controller *host = platform_get_drvdata(pdev);
|
||||||
struct octeon_spi *p = spi_master_get_devdata(master);
|
struct octeon_spi *p = spi_controller_get_devdata(host);
|
||||||
|
|
||||||
/* Clear the CSENA* and put everything in a known state. */
|
/* Clear the CSENA* and put everything in a known state. */
|
||||||
writeq(0, p->register_base + OCTEON_SPI_CFG(p));
|
writeq(0, p->register_base + OCTEON_SPI_CFG(p));
|
||||||
|
Loading…
Reference in New Issue
Block a user