#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>
 
        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;
        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),
        },
 };