aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.4/825-v5.8-spi-rb4xx-null-pointer-bug-fix.patch
diff options
context:
space:
mode:
authorChristopher Hill <ch6574@gmail.com>2020-05-25 21:00:00 -0400
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-06-15 21:16:18 +0200
commit344e75eb2b5653ed350121b4a7beb292049c24c0 (patch)
tree2e7d60da039f7bdb760bb9b8c76e63c76644424b /target/linux/generic/backport-5.4/825-v5.8-spi-rb4xx-null-pointer-bug-fix.patch
parentd64d5ed1425f4397d093c8777ca03f70ff1ee90c (diff)
downloadupstream-344e75eb2b5653ed350121b4a7beb292049c24c0.tar.gz
upstream-344e75eb2b5653ed350121b4a7beb292049c24c0.tar.bz2
upstream-344e75eb2b5653ed350121b4a7beb292049c24c0.zip
ath79: patch upstream Mikrotik rb4xx-spi driver to be device tree aware
Backport upstream patches that make drivers/spi/spi-rb4xx.c device tree aware, plus a null pointer fix. Signed-off-by: Christopher Hill <ch6574@gmail.com>
Diffstat (limited to 'target/linux/generic/backport-5.4/825-v5.8-spi-rb4xx-null-pointer-bug-fix.patch')
-rw-r--r--target/linux/generic/backport-5.4/825-v5.8-spi-rb4xx-null-pointer-bug-fix.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.4/825-v5.8-spi-rb4xx-null-pointer-bug-fix.patch b/target/linux/generic/backport-5.4/825-v5.8-spi-rb4xx-null-pointer-bug-fix.patch
new file mode 100644
index 0000000000..5d762c571c
--- /dev/null
+++ b/target/linux/generic/backport-5.4/825-v5.8-spi-rb4xx-null-pointer-bug-fix.patch
@@ -0,0 +1,50 @@
+From: Christopher Hill <ch6574@gmail.com>
+To: Mark Brown <broonie@kernel.org>
+Cc: Christopher Hill <ch6574@gmail.com>, linux-spi@vger.kernel.org,
+ linux-kernel@vger.kernel.org
+Subject: [PATCH 1/3] spi: rb4xx: null pointer bug fix
+Date: Thu, 21 May 2020 14:36:29 -0400
+Message-Id: <20200521183631.37806-1-ch6574@gmail.com>
+X-Mailer: git-send-email 2.25.1
+MIME-Version: 1.0
+Sender: linux-spi-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-spi.vger.kernel.org>
+X-Mailing-List: linux-spi@vger.kernel.org
+
+This patch fixes a null pointer bug in the spi driver spi-rb4xx.c by
+moving the private data initialization to earlier in probe
+
+Signed-off-by: Christopher Hill <ch6574@gmail.com>
+---
+ drivers/spi/spi-rb4xx.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/spi/spi-rb4xx.c b/drivers/spi/spi-rb4xx.c
+index 4c9620e0d18c..17e1a77dc132 100644
+--- a/drivers/spi/spi-rb4xx.c
++++ b/drivers/spi/spi-rb4xx.c
+@@ -158,6 +158,11 @@ static int rb4xx_spi_probe(struct platform_device *pdev)
+ master->transfer_one = rb4xx_transfer_one;
+ master->set_cs = rb4xx_set_cs;
+
++ rbspi = spi_master_get_devdata(master);
++ rbspi->base = spi_base;
++ rbspi->clk = ahb_clk;
++ platform_set_drvdata(pdev, rbspi);
++
+ err = devm_spi_register_master(&pdev->dev, master);
+ if (err) {
+ dev_err(&pdev->dev, "failed to register SPI master\n");
+@@ -168,11 +173,6 @@ static int rb4xx_spi_probe(struct platform_device *pdev)
+ if (err)
+ return err;
+
+- rbspi = spi_master_get_devdata(master);
+- rbspi->base = spi_base;
+- rbspi->clk = ahb_clk;
+- platform_set_drvdata(pdev, rbspi);
+-
+ /* Enable SPI */
+ rb4xx_write(rbspi, AR71XX_SPI_REG_FS, AR71XX_SPI_FS_GPIO);
+