]> Git Repo - linux.git/commitdiff
Merge remote-tracking branch 'spi/topic/coldfire-qspi' into spi-next
authorMark Brown <[email protected]>
Wed, 26 Jun 2013 15:20:57 +0000 (16:20 +0100)
committerMark Brown <[email protected]>
Wed, 26 Jun 2013 15:20:57 +0000 (16:20 +0100)
1  2 
drivers/spi/spi-coldfire-qspi.c

index 9a7db9d1b4ca68a6a812150bdbdd523acbec68e8,f99943bf3519fe20d8fa9351451e3a026e70f18a..15cda45afec606abff5a4122391f966e49c93044
@@@ -312,7 -312,10 +312,7 @@@ static int mcfqspi_transfer_one_message
                bool cs_high = spi->mode & SPI_CS_HIGH;
                u16 qmr = MCFQSPI_QMR_MSTR;
  
 -              if (t->bits_per_word)
 -                      qmr |= t->bits_per_word << 10;
 -              else
 -                      qmr |= spi->bits_per_word << 10;
 +              qmr |= t->bits_per_word << 10;
                if (spi->mode & SPI_CPHA)
                        qmr |= MCFQSPI_QMR_CPHA;
                if (spi->mode & SPI_CPOL)
@@@ -374,6 -377,11 +374,6 @@@ static int mcfqspi_unprepare_transfer_h
  
  static int mcfqspi_setup(struct spi_device *spi)
  {
 -      if ((spi->bits_per_word < 8) || (spi->bits_per_word > 16)) {
 -              dev_dbg(&spi->dev, "%d bits per word is not supported\n",
 -                      spi->bits_per_word);
 -              return -EINVAL;
 -      }
        if (spi->chip_select >= spi->master->num_chipselect) {
                dev_dbg(&spi->dev, "%d chip select is out of range\n",
                        spi->chip_select);
@@@ -400,6 -408,12 +400,12 @@@ static int mcfqspi_probe(struct platfor
        struct mcfqspi_platform_data *pdata;
        int status;
  
+       pdata = pdev->dev.platform_data;
+       if (!pdata) {
+               dev_dbg(&pdev->dev, "platform data is missing\n");
+               return -ENOENT;
+       }
        master = spi_alloc_master(&pdev->dev, sizeof(*mcfqspi));
        if (master == NULL) {
                dev_dbg(&pdev->dev, "spi_alloc_master failed\n");
        }
        clk_enable(mcfqspi->clk);
  
-       pdata = pdev->dev.platform_data;
-       if (!pdata) {
-               dev_dbg(&pdev->dev, "platform data is missing\n");
-               goto fail4;
-       }
        master->bus_num = pdata->bus_num;
        master->num_chipselect = pdata->num_chipselect;
  
        mcfqspi->dev = &pdev->dev;
  
        master->mode_bits = SPI_CS_HIGH | SPI_CPOL | SPI_CPHA;
 +      master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 16);
        master->setup = mcfqspi_setup;
        master->transfer_one_message = mcfqspi_transfer_one_message;
        master->prepare_transfer_hardware = mcfqspi_prepare_transfer_hw;
This page took 0.061062 seconds and 4 git commands to generate.