Merge remote-tracking branches 'spi/fix/spidev' and 'spi/fix/xtfpga' into spi-linus
authorMark Brown <broonie@kernel.org>
Tue, 22 Sep 2015 16:48:41 +0000 (09:48 -0700)
committerMark Brown <broonie@kernel.org>
Tue, 22 Sep 2015 16:48:41 +0000 (09:48 -0700)
1  2  3 
drivers/spi/spidev.c

diff --combined drivers/spi/spidev.c
index fba92a5265310c78acd9fb7e9c621f6d88942d24,e58ca17eb24735096b41dbcddc13405a36ddc936,fba92a5265310c78acd9fb7e9c621f6d88942d24..ef008e52f9537e788389b641f1707c72e0212ec9
@@@@ -602,11 -602,11 -602,11 +602,11 @@@@ static int spidev_open(struct inode *in
        if (!spidev->tx_buffer) {
                spidev->tx_buffer = kmalloc(bufsiz, GFP_KERNEL);
                if (!spidev->tx_buffer) {
 -                              dev_dbg(&spidev->spi->dev, "open/ENOMEM\n");
 -                              status = -ENOMEM;
 +                      dev_dbg(&spidev->spi->dev, "open/ENOMEM\n");
 +                      status = -ENOMEM;
                        goto err_find_dev;
 -                      }
                }
 +      }
   
        if (!spidev->rx_buffer) {
                spidev->rx_buffer = kmalloc(bufsiz, GFP_KERNEL);
@@@@ -651,7 -651,8 -651,7 +651,8 @@@@ static int spidev_release(struct inode 
                kfree(spidev->rx_buffer);
                spidev->rx_buffer = NULL;
   
- -             spidev->speed_hz = spidev->spi->max_speed_hz;
+ +             if (spidev->spi)
+ +                     spidev->speed_hz = spidev->spi->max_speed_hz;
   
                /* ... after we unbound from the underlying device? */
                spin_lock_irq(&spidev->spi_lock);
@@@@ -693,7 -694,6 -693,7 +694,7 @@@@ static struct class *spidev_class
   #ifdef CONFIG_OF
   static const struct of_device_id spidev_dt_ids[] = {
        { .compatible = "rohm,dh2228fv" },
 +      { .compatible = "lineartechnology,ltc2488" },
        {},
   };
   MODULE_DEVICE_TABLE(of, spidev_dt_ids);
@@@@ -709,7 -709,7 -709,7 +710,7 @@@@ static int spidev_probe(struct spi_devi
   
        /*
         * spidev should never be referenced in DT without a specific
 -       * compatbile string, it is a Linux implementation thing
 +       * compatible string, it is a Linux implementation thing
         * rather than a description of the hardware.
         */
        if (spi->dev.of_node && !of_match_device(spidev_dt_ids, &spi->dev)) {