spi: Remove duplicate code to set default bits_per_word setting
authorAxel Lin <axel.lin@ingics.com>
Fri, 17 Jan 2014 10:53:40 +0000 (18:53 +0800)
committerMark Brown <broonie@linaro.org>
Fri, 17 Jan 2014 15:54:22 +0000 (15:54 +0000)
The implementation in spi_setup() already set spi->bits_per_word = 8 when
spi->bits_per_word is 0 before calling spi->master->setup.
So we don't need to do it again in setup() callback.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Barry Song <Baohua.Song@csr.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-davinci.c
drivers/spi/spi-fsl-dspi.c
drivers/spi/spi-mxs.c
drivers/spi/spi-rspi.c
drivers/spi/spi-sc18is602.c
drivers/spi/spi-sh.c
drivers/spi/spi-sirf.c
drivers/spi/spi-topcliff-pch.c

index 50b2d88c81901c2b0b0ec1720f7e802ccf4924fb..ff22fb6a2a031d82647aba72f37bc81975362574 100644 (file)
@@ -396,10 +396,6 @@ static int davinci_spi_setup(struct spi_device *spi)
        dspi = spi_master_get_devdata(spi->master);
        pdata = &dspi->pdata;
 
-       /* if bits per word length is zero then set it default 8 */
-       if (!spi->bits_per_word)
-               spi->bits_per_word = 8;
-
        if (!(spi->mode & SPI_NO_CS)) {
                if ((pdata->chip_sel == NULL) ||
                    (pdata->chip_sel[spi->chip_select] == SPI_INTERN_CS))
index 8641b03bdd7a26f6057914a05e2095c4a9d22d0c..649f9d13eac5dfa2e0641cca207070d54954a018 100644 (file)
@@ -373,9 +373,6 @@ static int dspi_setup(struct spi_device *spi)
        if (!spi->max_speed_hz)
                return -EINVAL;
 
-       if (!spi->bits_per_word)
-               spi->bits_per_word = 8;
-
        return dspi_setup_transfer(spi, NULL);
 }
 
index 3adebfa22e3d785b6bf7ffb2149e77652039c3c3..79e5aa2250c89d48541d8d9eb263410c2aa66ac6 100644 (file)
@@ -111,14 +111,6 @@ static int mxs_spi_setup_transfer(struct spi_device *dev,
        return 0;
 }
 
-static int mxs_spi_setup(struct spi_device *dev)
-{
-       if (!dev->bits_per_word)
-               dev->bits_per_word = 8;
-
-       return 0;
-}
-
 static u32 mxs_spi_cs_to_reg(unsigned cs)
 {
        u32 select = 0;
@@ -502,7 +494,6 @@ static int mxs_spi_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        master->transfer_one_message = mxs_spi_transfer_one;
-       master->setup = mxs_spi_setup;
        master->bits_per_word_mask = SPI_BPW_MASK(8);
        master->mode_bits = SPI_CPOL | SPI_CPHA;
        master->num_chipselect = 3;
index 7838b7e71910468cd34f1d20454c44521347ad39..d1e89bb352d8cd614a9fb31d2ce3d44dd171475e 100644 (file)
@@ -802,8 +802,6 @@ static int rspi_setup(struct spi_device *spi)
 {
        struct rspi_data *rspi = spi_master_get_devdata(spi->master);
 
-       if (!spi->bits_per_word)
-               spi->bits_per_word = 8;
        rspi->max_speed_hz = spi->max_speed_hz;
 
        rspi->spcmd = SPCMD_SSLKP;
index c1a01d1ac3157211e0359a9a8b3235fae948db4f..1edffed9e098ee775a5ed7bbcc2b111fc796652d 100644 (file)
@@ -254,9 +254,6 @@ error:
 
 static int sc18is602_setup(struct spi_device *spi)
 {
-       if (!spi->bits_per_word)
-               spi->bits_per_word = 8;
-
        if (spi->mode & ~(SPI_CPHA | SPI_CPOL | SPI_LSB_FIRST))
                return -EINVAL;
 
index c120a70094f20f131cf0ef5e7a3861e57f9eba39..86a17d60a68c0f24b495c7257460d2fe558d2dcb 100644 (file)
@@ -358,9 +358,6 @@ static int spi_sh_setup(struct spi_device *spi)
 {
        struct spi_sh_data *ss = spi_master_get_devdata(spi->master);
 
-       if (!spi->bits_per_word)
-               spi->bits_per_word = 8;
-
        pr_debug("%s: enter\n", __func__);
 
        spi_sh_write(ss, 0xfe, SPI_SH_CR1);     /* SPI sycle stop */
index ed5e501c465276b6d39318818fa5d668d2685668..e430689c3837360f02e5e6d7e70a40ceae712777 100644 (file)
@@ -536,16 +536,9 @@ spi_sirfsoc_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
 
 static int spi_sirfsoc_setup(struct spi_device *spi)
 {
-       struct sirfsoc_spi *sspi;
-
        if (!spi->max_speed_hz)
                return -EINVAL;
 
-       sspi = spi_master_get_devdata(spi->master);
-
-       if (!spi->bits_per_word)
-               spi->bits_per_word = 8;
-
        return spi_sirfsoc_setup_transfer(spi, NULL);
 }
 
index 446131308acb26a1fac3ed8bfc1aad9e287404d5..9322de9e13fbbf4263832838821bed04c7694822 100644 (file)
@@ -466,12 +466,6 @@ static void pch_spi_reset(struct spi_master *master)
 
 static int pch_spi_setup(struct spi_device *pspi)
 {
-       /* check bits per word */
-       if (pspi->bits_per_word == 0) {
-               pspi->bits_per_word = 8;
-               dev_dbg(&pspi->dev, "%s 8 bits per word\n", __func__);
-       }
-
        /* Check baud rate setting */
        /* if baud rate of chip is greater than
           max we can support,return error */