All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-spi@vger.kernel.org>
Cc: <broonie@kernel.org>, <geert@linux-m68k.org>, <lukas@wunner.de>,
	<yangyingliang@huawei.com>
Subject: [PATCH -next 21/24] spi: xlp: switch to use modern name
Date: Tue, 22 Aug 2023 09:35:08 +0800	[thread overview]
Message-ID: <20230822013511.4161475-22-yangyingliang@huawei.com> (raw)
In-Reply-To: <20230822013511.4161475-1-yangyingliang@huawei.com>

Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/spi/spi-xlp.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/spi/spi-xlp.c b/drivers/spi/spi-xlp.c
index 3b91cdd5ae21..49302364b7bd 100644
--- a/drivers/spi/spi-xlp.c
+++ b/drivers/spi/spi-xlp.c
@@ -95,7 +95,7 @@ struct xlp_spi_priv {
 	int			rx_len;		/* rx xfer length */
 	int			txerrors;	/* TXFIFO underflow count */
 	int			rxerrors;	/* RXFIFO overflow count */
-	int			cs;		/* slave device chip select */
+	int			cs;		/* target device chip select */
 	u32			spi_clk;	/* spi clock frequency */
 	bool			cmd_cont;	/* cs active */
 	struct completion	done;		/* completion notification */
@@ -138,7 +138,7 @@ static int xlp_spi_setup(struct spi_device *spi)
 	u32 fdiv, cfg;
 	int cs;
 
-	xspi = spi_master_get_devdata(spi->master);
+	xspi = spi_controller_get_devdata(spi->controller);
 	cs = spi_get_chipselect(spi, 0);
 	/*
 	 * The value of fdiv must be between 4 and 65535.
@@ -343,17 +343,17 @@ static int xlp_spi_txrx_bufs(struct xlp_spi_priv *xs, struct spi_transfer *t)
 	return bytesleft;
 }
 
-static int xlp_spi_transfer_one(struct spi_master *master,
+static int xlp_spi_transfer_one(struct spi_controller *host,
 					struct spi_device *spi,
 					struct spi_transfer *t)
 {
-	struct xlp_spi_priv *xspi = spi_master_get_devdata(master);
+	struct xlp_spi_priv *xspi = spi_controller_get_devdata(host);
 	int ret = 0;
 
 	xspi->cs = spi_get_chipselect(spi, 0);
 	xspi->dev = spi->dev;
 
-	if (spi_transfer_is_last(master, t))
+	if (spi_transfer_is_last(host, t))
 		xspi->cmd_cont = 0;
 	else
 		xspi->cmd_cont = 1;
@@ -361,13 +361,13 @@ static int xlp_spi_transfer_one(struct spi_master *master,
 	if (xlp_spi_txrx_bufs(xspi, t))
 		ret = -EIO;
 
-	spi_finalize_current_transfer(master);
+	spi_finalize_current_transfer(host);
 	return ret;
 }
 
 static int xlp_spi_probe(struct platform_device *pdev)
 {
-	struct spi_master *master;
+	struct spi_controller *host;
 	struct xlp_spi_priv *xspi;
 	struct clk *clk;
 	int irq, err;
@@ -398,28 +398,28 @@ static int xlp_spi_probe(struct platform_device *pdev)
 
 	xspi->spi_clk = clk_get_rate(clk);
 
-	master = spi_alloc_master(&pdev->dev, 0);
-	if (!master) {
-		dev_err(&pdev->dev, "could not alloc master\n");
+	host = spi_alloc_host(&pdev->dev, 0);
+	if (!host) {
+		dev_err(&pdev->dev, "could not alloc host\n");
 		return -ENOMEM;
 	}
 
-	master->bus_num = 0;
-	master->num_chipselect = XLP_SPI_MAX_CS;
-	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
-	master->setup = xlp_spi_setup;
-	master->transfer_one = xlp_spi_transfer_one;
-	master->dev.of_node = pdev->dev.of_node;
+	host->bus_num = 0;
+	host->num_chipselect = XLP_SPI_MAX_CS;
+	host->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
+	host->setup = xlp_spi_setup;
+	host->transfer_one = xlp_spi_transfer_one;
+	host->dev.of_node = pdev->dev.of_node;
 
 	init_completion(&xspi->done);
-	spi_master_set_devdata(master, xspi);
+	spi_controller_set_devdata(host, xspi);
 	xlp_spi_sysctl_setup(xspi);
 
 	/* register spi controller */
-	err = devm_spi_register_master(&pdev->dev, master);
+	err = devm_spi_register_controller(&pdev->dev, host);
 	if (err) {
-		dev_err(&pdev->dev, "spi register master failed!\n");
-		spi_master_put(master);
+		dev_err(&pdev->dev, "spi register host failed!\n");
+		spi_controller_put(host);
 		return err;
 	}
 
-- 
2.25.1


  parent reply	other threads:[~2023-08-22  1:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22  1:34 [PATCH -next 00/24] spi: switch to use modern name (part5) Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 01/24] spi: sprd-adi: switch to use spi_alloc_host() Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 02/24] spi: sprd: switch to use modern name Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 03/24] spi: st-ssc4: " Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 04/24] spi: stm32-qspi: " Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 05/24] spi: stm32: " Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 06/24] spi: sun4i: " Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 07/24] spi: sun6i: " Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 08/24] spi: sunplus-sp7021: " Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 09/24] spi: synquacer: " Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 10/24] spi: geni-qcom: " Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 11/24] spi: tegra114: " Yang Yingliang
2023-08-22  1:34 ` [PATCH -next 12/24] spi: tegra20-sflash: " Yang Yingliang
2023-08-22  1:35 ` [PATCH -next 13/24] spi: tegra20-slink: " Yang Yingliang
2023-08-22  1:35 ` [PATCH -next 14/24] spi: tegra210-quad: " Yang Yingliang
2023-08-22  1:35 ` [PATCH -next 15/24] spi: spi-ti-qspi: " Yang Yingliang
2023-08-22  1:35 ` [PATCH -next 16/24] spi: wpcm-fiu: switch to use devm_spi_alloc_host() Yang Yingliang
2023-08-22  1:35 ` [PATCH -next 17/24] spi: topcliff-pch: switch to use modern name Yang Yingliang
2023-08-22  1:35 ` [PATCH -next 18/24] spi: uniphier: " Yang Yingliang
2023-08-22  1:35 ` [PATCH -next 19/24] spi: xcomm: " Yang Yingliang
2023-08-22  1:35 ` [PATCH -next 20/24] spi: xilinx: " Yang Yingliang
2023-08-22  1:35 ` Yang Yingliang [this message]
2023-08-22  1:35 ` [PATCH -next 22/24] spi: xtensa-xtfpga: " Yang Yingliang
2023-08-22  1:35 ` [PATCH -next 23/24] spi: zynq-qspi: " Yang Yingliang
2023-08-22  1:35 ` [PATCH -next 24/24] spi: zynqmp-gqspi: " Yang Yingliang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230822013511.4161475-22-yangyingliang@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=broonie@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lukas@wunner.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.