All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: Make spi_replaced_transfers private
@ 2021-10-13  9:27 Uwe Kleine-König
  2021-10-13 12:03 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2021-10-13  9:27 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

There are no users of struct spi_replaced_transfers and the
spi_replaced_release_t typedef apart from spi.c. So move their
definition there to not clutter the public namespace.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi.c       | 34 ++++++++++++++++++++++++++++++++++
 include/linux/spi/spi.h | 36 ------------------------------------
 2 files changed, 34 insertions(+), 36 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 50591de16e0f..e73498e6dee5 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3115,6 +3115,40 @@ EXPORT_SYMBOL_GPL(spi_controller_resume);
 
 /* Core methods for spi_message alterations */
 
+struct spi_replaced_transfers;
+typedef void (*spi_replaced_release_t)(struct spi_controller *ctlr,
+				       struct spi_message *msg,
+				       struct spi_replaced_transfers *res);
+/**
+ * struct spi_replaced_transfers - structure describing the spi_transfer
+ *                                 replacements that have occurred
+ *                                 so that they can get reverted
+ * @release:            some extra release code to get executed prior to
+ *                      relasing this structure
+ * @extradata:          pointer to some extra data if requested or NULL
+ * @replaced_transfers: transfers that have been replaced and which need
+ *                      to get restored
+ * @replaced_after:     the transfer after which the @replaced_transfers
+ *                      are to get re-inserted
+ * @inserted:           number of transfers inserted
+ * @inserted_transfers: array of spi_transfers of array-size @inserted,
+ *                      that have been replacing replaced_transfers
+ *
+ * note: that @extradata will point to @inserted_transfers[@inserted]
+ * if some extra allocation is requested, so alignment will be the same
+ * as for spi_transfers
+ */
+struct spi_replaced_transfers {
+	spi_replaced_release_t release;
+	void *extradata;
+	struct list_head replaced_transfers;
+	struct list_head *replaced_after;
+	size_t inserted;
+	struct spi_transfer inserted_transfers[];
+};
+
+/*---------------------------------------------------------------------------*/
+
 static void __spi_replace_transfers_release(struct spi_controller *ctlr,
 					    struct spi_message *msg,
 					    void *res)
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 29e21d49aafc..54fbec8acc20 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -1144,42 +1144,6 @@ static inline bool spi_is_bpw_supported(struct spi_device *spi, u32 bpw)
 
 /*---------------------------------------------------------------------------*/
 
-/* SPI transfer replacement methods which make use of spi_res */
-
-struct spi_replaced_transfers;
-typedef void (*spi_replaced_release_t)(struct spi_controller *ctlr,
-				       struct spi_message *msg,
-				       struct spi_replaced_transfers *res);
-/**
- * struct spi_replaced_transfers - structure describing the spi_transfer
- *                                 replacements that have occurred
- *                                 so that they can get reverted
- * @release:            some extra release code to get executed prior to
- *                      relasing this structure
- * @extradata:          pointer to some extra data if requested or NULL
- * @replaced_transfers: transfers that have been replaced and which need
- *                      to get restored
- * @replaced_after:     the transfer after which the @replaced_transfers
- *                      are to get re-inserted
- * @inserted:           number of transfers inserted
- * @inserted_transfers: array of spi_transfers of array-size @inserted,
- *                      that have been replacing replaced_transfers
- *
- * note: that @extradata will point to @inserted_transfers[@inserted]
- * if some extra allocation is requested, so alignment will be the same
- * as for spi_transfers
- */
-struct spi_replaced_transfers {
-	spi_replaced_release_t release;
-	void *extradata;
-	struct list_head replaced_transfers;
-	struct list_head *replaced_after;
-	size_t inserted;
-	struct spi_transfer inserted_transfers[];
-};
-
-/*---------------------------------------------------------------------------*/
-
 /* SPI transfer transformation methods */
 
 extern int spi_split_transfers_maxsize(struct spi_controller *ctlr,

base-commit: da21fde0fdb393c2fbe0ae0735cc826cd55fd46f
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: Make spi_replaced_transfers private
  2021-10-13  9:27 [PATCH] spi: Make spi_replaced_transfers private Uwe Kleine-König
@ 2021-10-13 12:03 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-10-13 12:03 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-spi, kernel

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

On Wed, Oct 13, 2021 at 11:27:11AM +0200, Uwe Kleine-König wrote:

> There are no users of struct spi_replaced_transfers and the
> spi_replaced_release_t typedef apart from spi.c. So move their
> definition there to not clutter the public namespace.

There may be some out of tree users with the Pi stuff, this was added
due to some aggressive optimisation work which was going on there.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-13 12:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13  9:27 [PATCH] spi: Make spi_replaced_transfers private Uwe Kleine-König
2021-10-13 12:03 ` Mark Brown

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.