Skip to contentSkip to conversation

treewide, spi: Get rid of SPI_MASTER_HALF_DUPLEX

PATCH In review Andy Shevchenko 6 participants 7 messages Nov 13, 2023 – Nov 16, 2023

Subsystems (8)
Networking Network drivers USB HID +4 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 treewide, spi: Get rid of SPI_MASTER_HALF_DUPLEX

The SPI_MASTER_HALF_DUPLEX is the legacy name of a definition for a half duplex flag. Since all others had been replaced with the respective SPI_CONTROLLER prefix get rid of the last one as well. There is no functional change intended.

---
 drivers/input/rmi4/rmi_spi.c             | 2 +-
 drivers/mmc/host/mmc_spi.c               | 2 +-
 drivers/net/ethernet/micrel/ks8851_spi.c | 4 ++--
 drivers/usb/gadget/udc/max3420_udc.c     | 2 +-
 include/linux/spi/spi.h                  | 2 --
 5 files changed, 5 insertions(+), 7 deletions(-)
drivers/input/rmi4/rmi_spi.c +1 -1
index 852aeb0b2c07..07c866f42296 100644
@@ -375,7 +375,7 @@ static int rmi_spi_probe(struct spi_device *spi)
 	struct rmi_device_platform_data *spi_pdata = spi->dev.platform_data;
 	int error;
 
-	if (spi->master->flags & SPI_MASTER_HALF_DUPLEX)
+	if (spi->master->flags & SPI_CONTROLLER_HALF_DUPLEX)
 		return -EINVAL;
 
 	rmi_spi = devm_kzalloc(&spi->dev, sizeof(struct rmi_spi_xport),
drivers/mmc/host/mmc_spi.c +1 -1
index cc333ad67cac..b0cccef4cfbf 100644
@@ -1322,7 +1322,7 @@ static int mmc_spi_probe(struct spi_device *spi)
 	/* We rely on full duplex transfers, mostly to reduce
 	 * per-transfer overheads (by making fewer transfers).
 	 */
-	if (spi->master->flags & SPI_MASTER_HALF_DUPLEX)
+	if (spi->master->flags & SPI_CONTROLLER_HALF_DUPLEX)
 		return -EINVAL;
 
 	/* MMC and SD specs only seem to care that sampling is on the
drivers/net/ethernet/micrel/ks8851_spi.c +2 -2
index 70bc7253454f..7c41623dac90 100644
@@ -156,7 +156,7 @@ static void ks8851_rdreg(struct ks8851_net *ks, unsigned int op,
 
 	txb[0] = cpu_to_le16(op | KS_SPIOP_RD);
 
-	if (kss->spidev->master->flags & SPI_MASTER_HALF_DUPLEX) {
+	if (kss->spidev->master->flags & SPI_CONTROLLER_HALF_DUPLEX) {
 		msg = &kss->spi_msg2;
 		xfer = kss->spi_xfer2;
 
@@ -180,7 +180,7 @@ static void ks8851_rdreg(struct ks8851_net *ks, unsigned int op,
 	ret = spi_sync(kss->spidev, msg);
 	if (ret < 0)
 		netdev_err(ks->netdev, "read: spi_sync() failed\n");
-	else if (kss->spidev->master->flags & SPI_MASTER_HALF_DUPLEX)
+	else if (kss->spidev->master->flags & SPI_CONTROLLER_HALF_DUPLEX)
 		memcpy(rxb, trx, rxl);
 	else
 		memcpy(rxb, trx + 2, rxl);
drivers/usb/gadget/udc/max3420_udc.c +1 -1
index 2d57786d3db7..89e8cf2a2a7d 100644
@@ -1201,7 +1201,7 @@ static int max3420_probe(struct spi_device *spi)
 	int err, irq;
 	u8 reg[8];
 
-	if (spi->master->flags & SPI_MASTER_HALF_DUPLEX) {
+	if (spi->master->flags & SPI_CONTROLLER_HALF_DUPLEX) {
 		dev_err(&spi->dev, "UDC needs full duplex to work\n");
 		return -EINVAL;
 	}
include/linux/spi/spi.h +0 -2
index 255a0562aea5..7b4baff63c5c 100644
@@ -1638,8 +1638,6 @@ spi_transfer_is_last(struct spi_controller *ctlr, struct spi_transfer *xfer)
 /* Compatibility layer */
 #define spi_master			spi_controller
 
-#define SPI_MASTER_HALF_DUPLEX		SPI_CONTROLLER_HALF_DUPLEX
-
 #define spi_master_get_devdata(_ctlr)	spi_controller_get_devdata(_ctlr)
 #define spi_master_set_devdata(_ctlr, _data)	\
 	spi_controller_set_devdata(_ctlr, _data)
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Andy Shevchenko

The SPI_MASTER_HALF_DUPLEX is the legacy name of a definition for a half duplex flag. Since all others had been replaced with the respective SPI_CONTROLLER prefix get rid of the last one as well. There is no functional change intended.

Quoted 8 lines
---
 drivers/input/rmi4/rmi_spi.c             | 2 +-
 drivers/mmc/host/mmc_spi.c               | 2 +-
 drivers/net/ethernet/micrel/ks8851_spi.c | 4 ++--
 drivers/usb/gadget/udc/max3420_udc.c     | 2 +-
 include/linux/spi/spi.h                  | 2 --
 5 files changed, 5 insertions(+), 7 deletions(-)

This should go through the spi tree, right? If so:

For the USB portion.

thanks,

greg k-h

#2 lore raw
Quoted 1 line · Greg Kroah-Hartman

On Mon, Nov 13, 2023 at 01:12:49PM +0200, Andy Shevchenko wrote:

...

Quoted 8 lines
Quoted 6 lines
 drivers/input/rmi4/rmi_spi.c             | 2 +-
 drivers/mmc/host/mmc_spi.c               | 2 +-
 drivers/net/ethernet/micrel/ks8851_spi.c | 4 ++--
 drivers/usb/gadget/udc/max3420_udc.c     | 2 +-
 include/linux/spi/spi.h                  | 2 --
 5 files changed, 5 insertions(+), 7 deletions(-)

This should go through the spi tree, right? If so:

Correct.

Quoted 3 lines

For the USB portion.

Thank you!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Acked-by on v1 1/1
#4 lore raw
In reply to Andy Shevchenko
Quoted 7 lines · Andy Shevchenko

The SPI_MASTER_HALF_DUPLEX is the legacy name of a definition for a half duplex flag. Since all others had been replaced with the respective SPI_CONTROLLER prefix get rid of the last one as well. There is no functional change intended.

Quoted 85 lines
---
 drivers/input/rmi4/rmi_spi.c             | 2 +-
 drivers/mmc/host/mmc_spi.c               | 2 +-
 drivers/net/ethernet/micrel/ks8851_spi.c | 4 ++--
 drivers/usb/gadget/udc/max3420_udc.c     | 2 +-
 include/linux/spi/spi.h                  | 2 --
 5 files changed, 5 insertions(+), 7 deletions(-)
drivers/input/rmi4/rmi_spi.c +1 -1
index 852aeb0b2c07..07c866f42296 100644
@@ -375,7 +375,7 @@ static int rmi_spi_probe(struct spi_device *spi)
        struct rmi_device_platform_data *spi_pdata = spi->dev.platform_data;
        int error;
 
-       if (spi->master->flags & SPI_MASTER_HALF_DUPLEX)
+       if (spi->master->flags & SPI_CONTROLLER_HALF_DUPLEX)
                return -EINVAL;
 
        rmi_spi = devm_kzalloc(&spi->dev, sizeof(struct rmi_spi_xport),
drivers/mmc/host/mmc_spi.c +1 -1
index cc333ad67cac..b0cccef4cfbf 100644
@@ -1322,7 +1322,7 @@ static int mmc_spi_probe(struct spi_device *spi)
        /* We rely on full duplex transfers, mostly to reduce
         * per-transfer overheads (by making fewer transfers).
         */
-       if (spi->master->flags & SPI_MASTER_HALF_DUPLEX)
+       if (spi->master->flags & SPI_CONTROLLER_HALF_DUPLEX)
                return -EINVAL;
 
        /* MMC and SD specs only seem to care that sampling is on the
drivers/net/ethernet/micrel/ks8851_spi.c +2 -2
index 70bc7253454f..7c41623dac90 100644
@@ -156,7 +156,7 @@ static void ks8851_rdreg(struct ks8851_net *ks, unsigned int op,
 
        txb[0] = cpu_to_le16(op | KS_SPIOP_RD);
 
-       if (kss->spidev->master->flags & SPI_MASTER_HALF_DUPLEX) {
+       if (kss->spidev->master->flags & SPI_CONTROLLER_HALF_DUPLEX) {
                msg = &kss->spi_msg2;
                xfer = kss->spi_xfer2;
 
@@ -180,7 +180,7 @@ static void ks8851_rdreg(struct ks8851_net *ks, unsigned int op,
        ret = spi_sync(kss->spidev, msg);
        if (ret < 0)
                netdev_err(ks->netdev, "read: spi_sync() failed\n");
-       else if (kss->spidev->master->flags & SPI_MASTER_HALF_DUPLEX)
+       else if (kss->spidev->master->flags & SPI_CONTROLLER_HALF_DUPLEX)
                memcpy(rxb, trx, rxl);
        else
                memcpy(rxb, trx + 2, rxl);
drivers/usb/gadget/udc/max3420_udc.c +1 -1
index 2d57786d3db7..89e8cf2a2a7d 100644
@@ -1201,7 +1201,7 @@ static int max3420_probe(struct spi_device *spi)
        int err, irq;
        u8 reg[8];
 
-       if (spi->master->flags & SPI_MASTER_HALF_DUPLEX) {
+       if (spi->master->flags & SPI_CONTROLLER_HALF_DUPLEX) {
                dev_err(&spi->dev, "UDC needs full duplex to work\n");
                return -EINVAL;
        }
include/linux/spi/spi.h +0 -3
index 255a0562aea5..7b4baff63c5c 100644
@@ -1638,8 +1638,6 @@ spi_transfer_is_last(struct spi_controller *ctlr, struct spi_transfer *xfer)
 /* Compatibility layer */
 #define spi_master                     spi_controller
 
-#define SPI_MASTER_HALF_DUPLEX         SPI_CONTROLLER_HALF_DUPLEX
-
 #define spi_master_get_devdata(_ctlr)  spi_controller_get_devdata(_ctlr)
 #define spi_master_set_devdata(_ctlr, _data)   \
        spi_controller_set_devdata(_ctlr, _data)
--

2.43.0.rc1.1.gbec44491f096

maintainer Acked-by on v1 1/1
#5 lore raw
In reply to Andy Shevchenko
Quoted 6 lines · Andy Shevchenko

The SPI_MASTER_HALF_DUPLEX is the legacy name of a definition for a half duplex flag. Since all others had been replaced with the respective SPI_CONTROLLER prefix get rid of the last one as well. There is no functional change intended.

Thanks.

Signature · 1 line
Dmitry
maintainer
#6 lore raw
In reply to Andy Shevchenko
Quoted 6 lines · Andy Shevchenko

The SPI_MASTER_HALF_DUPLEX is the legacy name of a definition for a half duplex flag. Since all others had been replaced with the respective SPI_CONTROLLER prefix get rid of the last one as well. There is no functional change intended.

Applied to

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

Thanks!

[1/1] treewide, spi: Get rid of SPI_MASTER_HALF_DUPLEX

      commit: 3fc6350fc8470d42f5e700ecd1c3d90f9dd9fd2d

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