Skip to contentSkip to conversation

spi: xilinx: Massage xilinx_spi.h

PATCH In review Andy Shevchenko 3 participants 7 messages Mar 8, 2024 – Mar 26, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover spi: xilinx: Massage xilinx_spi.h

Fix kernel documentation and inclusion block, and dropping the size of the num_chipselect.

In v2:
- added tags (Michal)
- reshuffled fields better to avoid gaps on 64-bits (Michal)

Andy Shevchenko (3):
spi: xilinx: Fix kernel documentation in the xilinx_spi.h
spi: xilinx: Add necessary inclusion and forward declaration
spi: xilinx: Make num_chipselect 8-bit in the struct
xspi_platform_data

 include/linux/spi/xilinx_spi.h | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#4 lore raw

PATCH v2 3/3 spi: xilinx: Make num_chipselect 8-bit in the struct xspi_platform_data

There is no use for whole 16-bit for the number of chip select pins. Drop it to 8 bits and reshuffle the data structure layout to avoid unnecessary paddings.

---
 include/linux/spi/xilinx_spi.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/spi/xilinx_spi.h +4 -4
index 4ba8f53ce570..1b8d984668b6 100644
@@ -8,17 +8,17 @@ struct spi_board_info;
 
 /**
  * struct xspi_platform_data - Platform data of the Xilinx SPI driver
- * @num_chipselect:	Number of chip select by the IP.
- * @bits_per_word:	Number of bits per word.
  * @devices:		Devices to add when the driver is probed.
  * @num_devices:	Number of devices in the devices array.
+ * @num_chipselect:	Number of chip select by the IP.
+ * @bits_per_word:	Number of bits per word.
  * @force_irq:		If set, forces QSPI transaction requirements.
  */
 struct xspi_platform_data {
-	u16 num_chipselect;
-	u8 bits_per_word;
 	struct spi_board_info *devices;
 	u8 num_devices;
+	u8 num_chipselect;
+	u8 bits_per_word;
 	bool force_irq;
 };
 
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#1 lore raw

PATCH v2 1/3 spi: xilinx: Fix kernel documentation in the xilinx_spi.h

In reply to Andy Shevchenko

While updating the data structure layout the kernel documentation became outdated. Synchronize kernel documentation with the actual data structure layout.

Fixes 1dd46599f83a ("spi: xilinx: add force_irq for QSPI mode")
Fixes 082339bc63cc ("spi: spi-xilinx: Add run run-time endian detection")
---
 include/linux/spi/xilinx_spi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/spi/xilinx_spi.h +1 -1
index 3934ce789d87..fd6add419e94 100644
@@ -5,10 +5,10 @@
 /**
  * struct xspi_platform_data - Platform data of the Xilinx SPI driver
  * @num_chipselect:	Number of chip select by the IP.
- * @little_endian:	If registers should be accessed little endian or not.
  * @bits_per_word:	Number of bits per word.
  * @devices:		Devices to add when the driver is probed.
  * @num_devices:	Number of devices in the devices array.
+ * @force_irq:		If set, forces QSPI transaction requirements.
  */
 struct xspi_platform_data {
 	u16 num_chipselect;
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#2 lore raw

PATCH v2 2/3 spi: xilinx: Add necessary inclusion and forward declaration

In reply to Andy Shevchenko

xilinx_spi.h is mnissing inclusion and forward declaration, add them.

---
 include/linux/spi/xilinx_spi.h | 4 ++++
 1 file changed, 4 insertions(+)
include/linux/spi/xilinx_spi.h +4 -0
index fd6add419e94..4ba8f53ce570 100644
@@ -2,6 +2,10 @@
 #ifndef __LINUX_SPI_XILINX_SPI_H
 #define __LINUX_SPI_XILINX_SPI_H
 
+#include <linux/types.h>
+
+struct spi_board_info;
+
 /**
  * struct xspi_platform_data - Platform data of the Xilinx SPI driver
  * @num_chipselect:	Number of chip select by the IP.
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
maintainer Acked-by on v2 2/3
#3 lore raw

Re: [PATCH v2 2/3] spi: xilinx: Add necessary inclusion and forward declaration

Quoted 12 lines · Andy Shevchenko

xilinx_spi.h is mnissing inclusion and forward declaration, add them.

---
  include/linux/spi/xilinx_spi.h | 4 ++++
  1 file changed, 4 insertions(+)
include/linux/spi/xilinx_spi.h +0 -0
index fd6add419e94..4ba8f53ce570 100644

include/linux/spi/xilinx_spi.h line 11

Quoted 10 lines
include/linux/spi/xilinx_spi.h +4 -0
@@ -2,6 +2,10 @@
  #ifndef __LINUX_SPI_XILINX_SPI_H
  #define __LINUX_SPI_XILINX_SPI_H
 
+#include <linux/types.h>
+
+struct spi_board_info;
+
  /**
   * struct xspi_platform_data - Platform data of the Xilinx SPI driver
   * @num_chipselect:	Number of chip select by the IP.

Thanks,
Michal

maintainer Reviewed-by on v2 3/3
#5 lore raw

Re: [PATCH v2 3/3] spi: xilinx: Make num_chipselect 8-bit in the struct xspi_platform_data

In reply to Andy Shevchenko
Quoted 25 lines · Andy Shevchenko

There is no use for whole 16-bit for the number of chip select pins. Drop it to 8 bits and reshuffle the data structure layout to avoid unnecessary paddings.

---
  include/linux/spi/xilinx_spi.h | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/spi/xilinx_spi.h +2 -2
index 4ba8f53ce570..1b8d984668b6 100644
@@ -8,17 +8,17 @@ struct spi_board_info;
 
  /**
   * struct xspi_platform_data - Platform data of the Xilinx SPI driver
- * @num_chipselect:	Number of chip select by the IP.
- * @bits_per_word:	Number of bits per word.
   * @devices:		Devices to add when the driver is probed.
   * @num_devices:	Number of devices in the devices array.
+ * @num_chipselect:	Number of chip select by the IP.
+ * @bits_per_word:	Number of bits per word.
   * @force_irq:		If set, forces QSPI transaction requirements.
   */

include/linux/spi/xilinx_spi.h struct spi_board_info; · line 24

Quoted 10 lines
include/linux/spi/xilinx_spi.h +2 -2
  struct xspi_platform_data {
-	u16 num_chipselect;
-	u8 bits_per_word;
  	struct spi_board_info *devices;
  	u8 num_devices;
+	u8 num_chipselect;
+	u8 bits_per_word;
  	bool force_irq;
  };
 

Thanks,
Michal

maintainer
#6 lore raw
In reply to Andy Shevchenko
Quoted 8 lines · Andy Shevchenko

Fix kernel documentation and inclusion block, and dropping the size of the num_chipselect.

In v2:
- added tags (Michal)
- reshuffled fields better to avoid gaps on 64-bits (Michal)

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] spi: xilinx: Fix kernel documentation in the xilinx_spi.h

      commit: d650d1c46d8471bf8ebf556629ac13077f13e647
[2/3] spi: xilinx: Add necessary inclusion and forward declaration
      commit: 8f40647d87610ecff6637d673024fe7bd045c913
[3/3] spi: xilinx: Make num_chipselect 8-bit in the struct xspi_platform_data
      commit: a39111b1cf0864b1782f30f9a1fa65260d057327

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark