1 From: Christopher Hill <ch6574@gmail.com>
2 To: Mark Brown <broonie@kernel.org>
3 Cc: Christopher Hill <ch6574@gmail.com>, linux-spi@vger.kernel.org,
4 linux-kernel@vger.kernel.org
5 Subject: [PATCH 2/3] spi: rb4xx: update driver to be device tree aware
6 Date: Thu, 21 May 2020 14:36:30 -0400
7 Message-Id: <20200521183631.37806-2-ch6574@gmail.com>
8 X-Mailer: git-send-email 2.25.1
9 In-Reply-To: <20200521183631.37806-1-ch6574@gmail.com>
10 References: <20200521183631.37806-1-ch6574@gmail.com>
12 Sender: linux-spi-owner@vger.kernel.org
14 List-ID: <linux-spi.vger.kernel.org>
15 X-Mailing-List: linux-spi@vger.kernel.org
17 This patch updates the spi driver spi-rb4xx.c to be device tree aware
19 Signed-off-by: Christopher Hill <ch6574@gmail.com>
21 drivers/spi/spi-rb4xx.c | 9 +++++++++
22 1 file changed, 9 insertions(+)
24 --- a/drivers/spi/spi-rb4xx.c
25 +++ b/drivers/spi/spi-rb4xx.c
27 #include <linux/platform_device.h>
28 #include <linux/clk.h>
29 #include <linux/spi/spi.h>
30 +#include <linux/of.h>
32 #include <asm/mach-ath79/ar71xx_regs.h>
34 @@ -150,6 +151,7 @@ static int rb4xx_spi_probe(struct platfo
36 return PTR_ERR(ahb_clk);
38 + master->dev.of_node = pdev->dev.of_node;
40 master->num_chipselect = 3;
41 master->mode_bits = SPI_TX_DUAL;
42 @@ -188,11 +190,18 @@ static int rb4xx_spi_remove(struct platf
46 +static const struct of_device_id rb4xx_spi_dt_match[] = {
47 + { .compatible = "mikrotik,rb4xx-spi" },
50 +MODULE_DEVICE_TABLE(of, rb4xx_spi_dt_match);
52 static struct platform_driver rb4xx_spi_drv = {
53 .probe = rb4xx_spi_probe,
54 .remove = rb4xx_spi_remove,
57 + .of_match_table = of_match_ptr(rb4xx_spi_dt_match),