diff mbox

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

Message ID 1420469376.6880.1.camel@phoenix (mailing list archive)
State Accepted
Commit b85bfc444c426f476e68000d5b7e64a3200c3892
Headers show

Commit Message

Axel Lin Jan. 5, 2015, 2:49 p.m. UTC
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().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/spi/spi-st-ssc4.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Mark Brown Jan. 14, 2015, 7:17 p.m. UTC | #1
On Mon, Jan 05, 2015 at 10:49:36PM +0800, Axel Lin wrote:
> 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.
Lee Jones Jan. 18, 2015, 12:44 p.m. UTC | #2
On Mon, 05 Jan 2015, Axel Lin wrote:

> 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().
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/spi/spi-st-ssc4.c | 6 ------
>  1 file changed, 6 deletions(-)

FWIW: Acked-by: Lee Jones <lee.jones@linaro.org>

> diff --git a/drivers/spi/spi-st-ssc4.c b/drivers/spi/spi-st-ssc4.c
> index 8f8770a..2faeaa7 100644
> --- a/drivers/spi/spi-st-ssc4.c
> +++ b/drivers/spi/spi-st-ssc4.c
> @@ -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;
diff mbox

Patch

diff --git a/drivers/spi/spi-st-ssc4.c b/drivers/spi/spi-st-ssc4.c
index 8f8770a..2faeaa7 100644
--- a/drivers/spi/spi-st-ssc4.c
+++ b/drivers/spi/spi-st-ssc4.c
@@ -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;