summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-rb4xx.c
diff options
context:
space:
mode:
authorChristopher Hill <ch6574@gmail.com>2020-05-21 20:36:30 +0200
committerMark Brown <broonie@kernel.org>2020-05-22 15:13:17 +0200
commit9a436c62fbb4c57c6f0be01e4fc368ed5da6b730 (patch)
tree101a9860e4def22ed62b7174b1ed1d59918739ff /drivers/spi/spi-rb4xx.c
parentspi: rb4xx: null pointer bug fix (diff)
downloadlinux-9a436c62fbb4c57c6f0be01e4fc368ed5da6b730.tar.xz
linux-9a436c62fbb4c57c6f0be01e4fc368ed5da6b730.zip
spi: rb4xx: update driver to be device tree aware
This patch updates the spi driver spi-rb4xx.c to be device tree aware Signed-off-by: Christopher Hill <ch6574@gmail.com> Link: https://lore.kernel.org/r/20200521183631.37806-2-ch6574@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-rb4xx.c')
-rw-r--r--drivers/spi/spi-rb4xx.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/spi/spi-rb4xx.c b/drivers/spi/spi-rb4xx.c
index 17e1a77dc132..8aa51beb4ff3 100644
--- a/drivers/spi/spi-rb4xx.c
+++ b/drivers/spi/spi-rb4xx.c
@@ -14,6 +14,7 @@
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/spi/spi.h>
+#include <linux/of.h>
#include <asm/mach-ath79/ar71xx_regs.h>
@@ -150,6 +151,7 @@ static int rb4xx_spi_probe(struct platform_device *pdev)
if (IS_ERR(ahb_clk))
return PTR_ERR(ahb_clk);
+ master->dev.of_node = pdev->dev.of_node;
master->bus_num = 0;
master->num_chipselect = 3;
master->mode_bits = SPI_TX_DUAL;
@@ -188,11 +190,18 @@ static int rb4xx_spi_remove(struct platform_device *pdev)
return 0;
}
+static const struct of_device_id rb4xx_spi_dt_match[] = {
+ { .compatible = "mikrotik,rb4xx-spi" },
+ { },
+};
+MODULE_DEVICE_TABLE(of, rb4xx_spi_dt_match);
+
static struct platform_driver rb4xx_spi_drv = {
.probe = rb4xx_spi_probe,
.remove = rb4xx_spi_remove,
.driver = {
.name = "rb4xx-spi",
+ .of_match_table = of_match_ptr(rb4xx_spi_dt_match),
},
};