Skip to contentSkip to conversation

spi: st-ssc4: Remove duplicate code to test unsupported mode bits

PATCH Applied Axel Lin 3 participants 3 messages Jan 5, 2015 – Jan 18, 2015 SPI

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 spi: st-ssc4: Remove duplicate code to test unsupported mode bits

spi_setup() will test unsupported mode bits before calling spi->master->setup. Thus remove duplicate code to test unsupported mode bits in spi_st_setup().

---
 drivers/spi/spi-st-ssc4.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/spi/spi-st-ssc4.c +0 -6
index 8f8770a..2faeaa7 100644
@@ -217,12 +217,6 @@ static int spi_st_setup(struct spi_device *spi)
 	int cs = spi->cs_gpio;
 	int ret;
 
-	if (spi->mode & ~MODEBITS) {
-		dev_err(&spi->dev, "unsupported mode bits 0x%x\n",
-			spi->mode & ~MODEBITS);
-		return -EINVAL;
-	}
-
 	if (!hz)  {
 		dev_err(&spi->dev, "max_speed_hz unspecified\n");
 		return -EINVAL;
Signature · 8 lines
1.9.1



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#1 lore raw
Quoted 2 lines · Axel Lin

spi_setup() will test unsupported mode bits before calling spi->master->setup. Thus remove duplicate code to test unsupported mode bits in spi_st_setup().

Applied, thanks.

#2 lore raw
In reply to Axel Lin
Quoted 7 lines · Axel Lin

spi_setup() will test unsupported mode bits before calling spi->master->setup. Thus remove duplicate code to test unsupported mode bits in spi_st_setup().

---
 drivers/spi/spi-st-ssc4.c | 6 ------
 1 file changed, 6 deletions(-)

FWIW: Acked-by: Lee Jones <[email protected]>

Quoted 17 lines
drivers/spi/spi-st-ssc4.c +0 -6
index 8f8770a..2faeaa7 100644
@@ -217,12 +217,6 @@ static int spi_st_setup(struct spi_device *spi)
 	int cs = spi->cs_gpio;
 	int ret;
 
-	if (spi->mode & ~MODEBITS) {
-		dev_err(&spi->dev, "unsupported mode bits 0x%x\n",
-			spi->mode & ~MODEBITS);
-		return -EINVAL;
-	}
-
 	if (!hz)  {
 		dev_err(&spi->dev, "max_speed_hz unspecified\n");
 		return -EINVAL;
Signature · 8 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html