Commit 104db052 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'spi-fix-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A few small driver specific fixes, the most important being the
  s3c64xx change which is likely to be hit during normal operation"

* tag 'spi-fix-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: mchp-pci1xxx: Fix a possible null pointer dereference in pci1xxx_spi_probe
  spi: spi-fsl-lpspi: remove redundant spi_controller_put call
  spi: s3c64xx: Use DMA mode from fifo size
parents 20668408 1f886a7b
...@@ -852,39 +852,39 @@ static int fsl_lpspi_probe(struct platform_device *pdev) ...@@ -852,39 +852,39 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
fsl_lpspi->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); fsl_lpspi->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(fsl_lpspi->base)) { if (IS_ERR(fsl_lpspi->base)) {
ret = PTR_ERR(fsl_lpspi->base); ret = PTR_ERR(fsl_lpspi->base);
goto out_controller_put; return ret;
} }
fsl_lpspi->base_phys = res->start; fsl_lpspi->base_phys = res->start;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
ret = irq; ret = irq;
goto out_controller_put; return ret;
} }
ret = devm_request_irq(&pdev->dev, irq, fsl_lpspi_isr, 0, ret = devm_request_irq(&pdev->dev, irq, fsl_lpspi_isr, 0,
dev_name(&pdev->dev), fsl_lpspi); dev_name(&pdev->dev), fsl_lpspi);
if (ret) { if (ret) {
dev_err(&pdev->dev, "can't get irq%d: %d\n", irq, ret); dev_err(&pdev->dev, "can't get irq%d: %d\n", irq, ret);
goto out_controller_put; return ret;
} }
fsl_lpspi->clk_per = devm_clk_get(&pdev->dev, "per"); fsl_lpspi->clk_per = devm_clk_get(&pdev->dev, "per");
if (IS_ERR(fsl_lpspi->clk_per)) { if (IS_ERR(fsl_lpspi->clk_per)) {
ret = PTR_ERR(fsl_lpspi->clk_per); ret = PTR_ERR(fsl_lpspi->clk_per);
goto out_controller_put; return ret;
} }
fsl_lpspi->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); fsl_lpspi->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
if (IS_ERR(fsl_lpspi->clk_ipg)) { if (IS_ERR(fsl_lpspi->clk_ipg)) {
ret = PTR_ERR(fsl_lpspi->clk_ipg); ret = PTR_ERR(fsl_lpspi->clk_ipg);
goto out_controller_put; return ret;
} }
/* enable the clock */ /* enable the clock */
ret = fsl_lpspi_init_rpm(fsl_lpspi); ret = fsl_lpspi_init_rpm(fsl_lpspi);
if (ret) if (ret)
goto out_controller_put; return ret;
ret = pm_runtime_get_sync(fsl_lpspi->dev); ret = pm_runtime_get_sync(fsl_lpspi->dev);
if (ret < 0) { if (ret < 0) {
...@@ -945,8 +945,6 @@ static int fsl_lpspi_probe(struct platform_device *pdev) ...@@ -945,8 +945,6 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
pm_runtime_dont_use_autosuspend(fsl_lpspi->dev); pm_runtime_dont_use_autosuspend(fsl_lpspi->dev);
pm_runtime_put_sync(fsl_lpspi->dev); pm_runtime_put_sync(fsl_lpspi->dev);
pm_runtime_disable(fsl_lpspi->dev); pm_runtime_disable(fsl_lpspi->dev);
out_controller_put:
spi_controller_put(controller);
return ret; return ret;
} }
......
...@@ -725,6 +725,8 @@ static int pci1xxxx_spi_probe(struct pci_dev *pdev, const struct pci_device_id * ...@@ -725,6 +725,8 @@ static int pci1xxxx_spi_probe(struct pci_dev *pdev, const struct pci_device_id *
spi_bus->spi_int[iter] = devm_kzalloc(&pdev->dev, spi_bus->spi_int[iter] = devm_kzalloc(&pdev->dev,
sizeof(struct pci1xxxx_spi_internal), sizeof(struct pci1xxxx_spi_internal),
GFP_KERNEL); GFP_KERNEL);
if (!spi_bus->spi_int[iter])
return -ENOMEM;
spi_sub_ptr = spi_bus->spi_int[iter]; spi_sub_ptr = spi_bus->spi_int[iter];
spi_sub_ptr->spi_host = devm_spi_alloc_host(dev, sizeof(struct spi_controller)); spi_sub_ptr->spi_host = devm_spi_alloc_host(dev, sizeof(struct spi_controller));
if (!spi_sub_ptr->spi_host) if (!spi_sub_ptr->spi_host)
......
...@@ -430,7 +430,7 @@ static bool s3c64xx_spi_can_dma(struct spi_controller *host, ...@@ -430,7 +430,7 @@ static bool s3c64xx_spi_can_dma(struct spi_controller *host,
struct s3c64xx_spi_driver_data *sdd = spi_controller_get_devdata(host); struct s3c64xx_spi_driver_data *sdd = spi_controller_get_devdata(host);
if (sdd->rx_dma.ch && sdd->tx_dma.ch) if (sdd->rx_dma.ch && sdd->tx_dma.ch)
return xfer->len > sdd->fifo_depth; return xfer->len >= sdd->fifo_depth;
return false; return false;
} }
...@@ -826,10 +826,9 @@ static int s3c64xx_spi_transfer_one(struct spi_controller *host, ...@@ -826,10 +826,9 @@ static int s3c64xx_spi_transfer_one(struct spi_controller *host,
return status; return status;
} }
if (!is_polling(sdd) && (xfer->len > fifo_len) && if (!is_polling(sdd) && xfer->len >= fifo_len &&
sdd->rx_dma.ch && sdd->tx_dma.ch) { sdd->rx_dma.ch && sdd->tx_dma.ch) {
use_dma = 1; use_dma = 1;
} else if (xfer->len >= fifo_len) { } else if (xfer->len >= fifo_len) {
tx_buf = xfer->tx_buf; tx_buf = xfer->tx_buf;
rx_buf = xfer->rx_buf; rx_buf = xfer->rx_buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment