spi: falcon: switch to use modern name
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 7 Aug 2023 12:40:49 +0000 (20:40 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 14 Aug 2023 12:10:51 +0000 (13:10 +0100)
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>
drivers/spi/spi-falcon.c

index 8a8414c..8427905 100644 (file)
 
 struct falcon_sflash {
        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,
                unsigned long flags)
 {
        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;
        u8 *rxp = t->rx_buf;
        unsigned int bytelen = ((8 * t->len + 7) / 8);
@@ -351,10 +351,10 @@ static int falcon_sflash_setup(struct spi_device *spi)
        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 falcon_sflash *priv = spi_master_get_devdata(master);
+       struct falcon_sflash *priv = spi_controller_get_devdata(host);
        struct spi_transfer *t;
        unsigned long spi_flags;
        unsigned long flags;
@@ -382,7 +382,7 @@ static int falcon_sflash_xfer_one(struct spi_master *master,
        }
 
        m->status = ret;
-       spi_finalize_current_message(master);
+       spi_finalize_current_message(host);
 
        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)
 {
        struct falcon_sflash *priv;
-       struct spi_master *master;
+       struct spi_controller *host;
        int ret;
 
-       master = spi_alloc_master(&pdev->dev, sizeof(*priv));
-       if (!master)
+       host = spi_alloc_host(&pdev->dev, sizeof(*priv));
+       if (!host)
                return -ENOMEM;
 
-       priv = spi_master_get_devdata(master);
-       priv->master = master;
+       priv = spi_controller_get_devdata(host);
+       priv->host = host;
 
-       master->mode_bits = SPI_MODE_3;
-       master->flags = SPI_CONTROLLER_HALF_DUPLEX;
-       master->setup = falcon_sflash_setup;
-       master->transfer_one_message = falcon_sflash_xfer_one;
-       master->dev.of_node = pdev->dev.of_node;
+       host->mode_bits = SPI_MODE_3;
+       host->flags = SPI_CONTROLLER_HALF_DUPLEX;
+       host->setup = falcon_sflash_setup;
+       host->transfer_one_message = falcon_sflash_xfer_one;
+       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)
-               spi_master_put(master);
+               spi_controller_put(host);
        return ret;
 }