All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Mark Brown <broonie@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	Viresh Kumar <vireshk@kernel.org>,
	Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev
Subject: [PATCH 26/33] staging: greybus: spi: Follow renaming of SPI "master" to "controller"
Date: Mon, 15 Jan 2024 21:13:12 +0100	[thread overview]
Message-ID: <188f907d08d4a57d1058f01bc4939f209a4c8e43.1705348270.git.u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <cover.1705348269.git.u.kleine-koenig@pengutronix.de>

In commit 8caab75fd2c2 ("spi: Generalize SPI "master" to "controller"")
some functions and struct members were renamed. To not break all drivers
compatibility macros were provided.

To be able to remove these compatibility macros push the renaming into
this driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/staging/greybus/spilib.c | 66 ++++++++++++++++----------------
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/greybus/spilib.c b/drivers/staging/greybus/spilib.c
index efb3bec58e15..34f10685139f 100644
--- a/drivers/staging/greybus/spilib.c
+++ b/drivers/staging/greybus/spilib.c
@@ -42,7 +42,7 @@ struct gb_spilib {
 
 #define XFER_TIMEOUT_TOLERANCE		200
 
-static struct spi_master *get_master_from_spi(struct gb_spilib *spi)
+static struct spi_controller *get_controller_from_spi(struct gb_spilib *spi)
 {
 	return gb_connection_get_data(spi->connection);
 }
@@ -324,10 +324,10 @@ static void gb_spi_decode_response(struct gb_spilib *spi,
 	}
 }
 
-static int gb_spi_transfer_one_message(struct spi_master *master,
+static int gb_spi_transfer_one_message(struct spi_controller *ctlr,
 				       struct spi_message *msg)
 {
-	struct gb_spilib *spi = spi_master_get_devdata(master);
+	struct gb_spilib *spi = spi_controller_get_devdata(ctlr);
 	struct gb_connection *connection = spi->connection;
 	struct gb_spi_transfer_response *response;
 	struct gb_operation *operation;
@@ -371,21 +371,21 @@ static int gb_spi_transfer_one_message(struct spi_master *master,
 out:
 	msg->status = ret;
 	clean_xfer_state(spi);
-	spi_finalize_current_message(master);
+	spi_finalize_current_message(ctlr);
 
 	return ret;
 }
 
-static int gb_spi_prepare_transfer_hardware(struct spi_master *master)
+static int gb_spi_prepare_transfer_hardware(struct spi_controller *ctlr)
 {
-	struct gb_spilib *spi = spi_master_get_devdata(master);
+	struct gb_spilib *spi = spi_controller_get_devdata(ctlr);
 
 	return spi->ops->prepare_transfer_hardware(spi->parent);
 }
 
-static int gb_spi_unprepare_transfer_hardware(struct spi_master *master)
+static int gb_spi_unprepare_transfer_hardware(struct spi_controller *ctlr)
 {
-	struct gb_spilib *spi = spi_master_get_devdata(master);
+	struct gb_spilib *spi = spi_controller_get_devdata(ctlr);
 
 	spi->ops->unprepare_transfer_hardware(spi->parent);
 
@@ -440,7 +440,7 @@ static int gb_spi_get_master_config(struct gb_spilib *spi)
 
 static int gb_spi_setup_device(struct gb_spilib *spi, u8 cs)
 {
-	struct spi_master *master = get_master_from_spi(spi);
+	struct spi_controller *ctlr = get_controller_from_spi(spi);
 	struct gb_spi_device_config_request request;
 	struct gb_spi_device_config_response response;
 	struct spi_board_info spi_board = { {0} };
@@ -471,11 +471,11 @@ static int gb_spi_setup_device(struct gb_spilib *spi, u8 cs)
 		return -EINVAL;
 
 	spi_board.mode		= le16_to_cpu(response.mode);
-	spi_board.bus_num	= master->bus_num;
+	spi_board.bus_num	= ctlr->bus_num;
 	spi_board.chip_select	= cs;
 	spi_board.max_speed_hz	= le32_to_cpu(response.max_speed_hz);
 
-	spidev = spi_new_device(master, &spi_board);
+	spidev = spi_new_device(ctlr, &spi_board);
 	if (!spidev)
 		return -EINVAL;
 
@@ -486,52 +486,52 @@ int gb_spilib_master_init(struct gb_connection *connection, struct device *dev,
 			  struct spilib_ops *ops)
 {
 	struct gb_spilib *spi;
-	struct spi_master *master;
+	struct spi_controller *ctlr;
 	int ret;
 	u8 i;
 
 	/* Allocate master with space for data */
-	master = spi_alloc_master(dev, sizeof(*spi));
-	if (!master) {
+	ctlr = spi_alloc_master(dev, sizeof(*spi));
+	if (!ctlr) {
 		dev_err(dev, "cannot alloc SPI master\n");
 		return -ENOMEM;
 	}
 
-	spi = spi_master_get_devdata(master);
+	spi = spi_controller_get_devdata(ctlr);
 	spi->connection = connection;
-	gb_connection_set_data(connection, master);
+	gb_connection_set_data(connection, ctlr);
 	spi->parent = dev;
 	spi->ops = ops;
 
-	/* get master configuration */
+	/* get controller configuration */
 	ret = gb_spi_get_master_config(spi);
 	if (ret)
 		goto exit_spi_put;
 
-	master->bus_num = -1; /* Allow spi-core to allocate it dynamically */
-	master->num_chipselect = spi->num_chipselect;
-	master->mode_bits = spi->mode;
-	master->flags = spi->flags;
-	master->bits_per_word_mask = spi->bits_per_word_mask;
+	ctlr->bus_num = -1; /* Allow spi-core to allocate it dynamically */
+	ctlr->num_chipselect = spi->num_chipselect;
+	ctlr->mode_bits = spi->mode;
+	ctlr->flags = spi->flags;
+	ctlr->bits_per_word_mask = spi->bits_per_word_mask;
 
 	/* Attach methods */
-	master->cleanup = gb_spi_cleanup;
-	master->setup = gb_spi_setup;
-	master->transfer_one_message = gb_spi_transfer_one_message;
+	ctlr->cleanup = gb_spi_cleanup;
+	ctlr->setup = gb_spi_setup;
+	ctlr->transfer_one_message = gb_spi_transfer_one_message;
 
 	if (ops && ops->prepare_transfer_hardware) {
-		master->prepare_transfer_hardware =
+		ctlr->prepare_transfer_hardware =
 			gb_spi_prepare_transfer_hardware;
 	}
 
 	if (ops && ops->unprepare_transfer_hardware) {
-		master->unprepare_transfer_hardware =
+		ctlr->unprepare_transfer_hardware =
 			gb_spi_unprepare_transfer_hardware;
 	}
 
-	master->auto_runtime_pm = true;
+	ctlr->auto_runtime_pm = true;
 
-	ret = spi_register_master(master);
+	ret = spi_register_controller(ctlr);
 	if (ret < 0)
 		goto exit_spi_put;
 
@@ -548,12 +548,12 @@ int gb_spilib_master_init(struct gb_connection *connection, struct device *dev,
 	return 0;
 
 exit_spi_put:
-	spi_master_put(master);
+	spi_controller_put(ctlr);
 
 	return ret;
 
 exit_spi_unregister:
-	spi_unregister_master(master);
+	spi_unregister_controller(ctlr);
 
 	return ret;
 }
@@ -561,9 +561,9 @@ EXPORT_SYMBOL_GPL(gb_spilib_master_init);
 
 void gb_spilib_master_exit(struct gb_connection *connection)
 {
-	struct spi_master *master = gb_connection_get_data(connection);
+	struct spi_controller *ctlr = gb_connection_get_data(connection);
 
-	spi_unregister_master(master);
+	spi_unregister_controller(ctlr);
 }
 EXPORT_SYMBOL_GPL(gb_spilib_master_exit);
 
-- 
2.43.0


  parent reply	other threads:[~2024-01-15 20:21 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 20:12 [PATCH 00/33] spi: get rid of some legacy macros Uwe Kleine-König
2024-01-15 20:12 ` Uwe Kleine-König
2024-01-15 20:12 ` Uwe Kleine-König
2024-01-15 20:12 ` [PATCH 01/33] fpga: ice40-spi: Follow renaming of SPI "master" to "controller" Uwe Kleine-König
2024-01-20 15:29   ` Xu Yilun
2024-01-15 20:12 ` [PATCH 02/33] ieee802154: ca8210: " Uwe Kleine-König
2024-01-16 20:06   ` Simon Horman
2024-01-17 12:19   ` Stefan Schmidt
2024-01-15 20:12 ` [PATCH 03/33] iio: adc: ad_sigma_delta: " Uwe Kleine-König
2024-01-16  7:44   ` Nuno Sá
2024-01-21 16:27     ` Jonathan Cameron
2024-01-15 20:12 ` [PATCH 04/33] Input: pxspad - follow " Uwe Kleine-König
2024-01-16 19:14   ` Dmitry Torokhov
2024-01-15 20:12 ` [PATCH 05/33] Input: synaptics-rmi4 " Uwe Kleine-König
2024-01-16 19:14   ` Dmitry Torokhov
2024-01-15 20:12 ` [PATCH 06/33] media: mgb4: Follow " Uwe Kleine-König
2024-01-16 10:17   ` Martin Tůma
2024-01-15 20:12 ` [PATCH 07/33] media: netup_unidvb: " Uwe Kleine-König
2024-01-15 20:12 ` [PATCH 08/33] media: usb/msi2500: " Uwe Kleine-König
2024-01-15 20:12 ` [PATCH 09/33] media: v4l2-subdev: " Uwe Kleine-König
2024-01-15 20:12 ` [PATCH 10/33] misc: gehc-achc: " Uwe Kleine-König
2024-01-15 20:12 ` [PATCH 11/33] mmc: mmc_spi: " Uwe Kleine-König
2024-01-15 20:12 ` [PATCH 12/33] mtd: dataflash: " Uwe Kleine-König
2024-01-15 20:12   ` Uwe Kleine-König
2024-01-15 20:12 ` [PATCH 13/33] mtd: rawnand: fsl_elbc: Let .probe retry if local bus is missing Uwe Kleine-König
2024-01-15 20:12   ` Uwe Kleine-König
2024-01-15 20:13 ` [PATCH 14/33] net: ks8851: Follow renaming of SPI "master" to "controller" Uwe Kleine-König
2024-01-16 20:05   ` Simon Horman
2024-01-15 20:13 ` [PATCH 15/33] net: vertexcom: mse102x: " Uwe Kleine-König
2024-01-16 20:05   ` Simon Horman
2024-01-15 20:13 ` [PATCH 16/33] platform/chrome: cros_ec_spi: " Uwe Kleine-König
2024-01-18  3:49   ` Tzung-Bi Shih
2024-01-15 20:13 ` [PATCH 17/33] spi: bitbang: " Uwe Kleine-König
2024-01-15 20:13   ` Uwe Kleine-König
2024-01-16  8:33   ` Geert Uytterhoeven
2024-01-16  8:33     ` Geert Uytterhoeven
2024-01-16 12:47     ` Uwe Kleine-König
2024-01-16 12:47       ` Uwe Kleine-König
2024-01-19  7:11   ` kernel test robot
2024-01-19  7:11     ` kernel test robot
2024-01-15 20:13 ` [PATCH 18/33] spi: cadence-quadspi: Don't emit error message on allocation error Uwe Kleine-König
2024-01-15 20:13 ` [PATCH 19/33] spi: cadence-quadspi: Follow renaming of SPI "master" to "controller" Uwe Kleine-König
2024-01-15 20:13 ` [PATCH 20/33] spi: cavium: " Uwe Kleine-König
2024-01-15 20:13 ` [PATCH 21/33] spi: geni-qcom: " Uwe Kleine-König
2024-01-15 20:13 ` [PATCH 22/33] spi: loopback-test: " Uwe Kleine-König
2024-01-15 20:13 ` [PATCH 23/33] spi: slave-mt27xx: " Uwe Kleine-König
2024-01-15 20:13   ` Uwe Kleine-König
2024-01-16 15:41   ` Mark Brown
2024-01-16 15:41     ` Mark Brown
2024-01-15 20:13 ` [PATCH 24/33] spi: spidev: " Uwe Kleine-König
2024-01-15 20:13 ` [PATCH 25/33] staging: fbtft: " Uwe Kleine-König
2024-01-15 20:13   ` Uwe Kleine-König
2024-01-15 20:13 ` Uwe Kleine-König [this message]
2024-01-16  5:38   ` [PATCH 26/33] staging: greybus: spi: " Viresh Kumar
2024-01-15 20:13 ` [PATCH 27/33] tpm_tis_spi: " Uwe Kleine-König
2024-01-19 21:29   ` Jarkko Sakkinen
2024-01-15 20:13 ` [PATCH 28/33] usb: gadget: max3420_udc: " Uwe Kleine-König
2024-01-16  7:25   ` Herve Codina
2024-01-15 20:13 ` [PATCH 29/33] video: fbdev: mmp: " Uwe Kleine-König
2024-01-15 20:13   ` Uwe Kleine-König
2024-01-15 20:13 ` [PATCH 30/33] wifi: libertas: " Uwe Kleine-König
2024-01-18  9:26   ` Kalle Valo
2024-01-15 20:13 ` [PATCH 31/33] spi: fsl-lib: " Uwe Kleine-König
2024-01-15 20:13 ` [PATCH 32/33] spi: Drop compat layer from renaming " Uwe Kleine-König
2024-01-15 20:13 ` [PATCH 33/33] Documentation: spi: Update documentation for " Uwe Kleine-König
2024-01-16 14:40 ` [PATCH 00/33] spi: get rid of some legacy macros Mark Brown
2024-01-16 14:40   ` Mark Brown
2024-01-16 14:40   ` Mark Brown
2024-01-16 15:18   ` Uwe Kleine-König
2024-01-16 15:18     ` Uwe Kleine-König
2024-01-16 15:18     ` Uwe Kleine-König

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=188f907d08d4a57d1058f01bc4939f209a4c8e43.1705348270.git.u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=broonie@kernel.org \
    --cc=elder@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=rmfrfs@gmail.com \
    --cc=vireshk@kernel.org \
    /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.