mrf24j40: add device-tree support
[linux-2.6-block.git] / drivers / net / ieee802154 / mrf24j40.c
index 41d9f577014869878c2472ad368c2309529fb310..89150bd43ab2840de6dd59bc76d1b23fd51272d2 100644 (file)
@@ -799,6 +799,14 @@ static int mrf24j40_remove(struct spi_device *spi)
        return 0;
 }
 
+static const struct of_device_id mrf24j40_of_match[] = {
+       { .compatible = "microchip,mrf24j40", .data = (void *)MRF24J40 },
+       { .compatible = "microchip,mrf24j40ma", .data = (void *)MRF24J40MA },
+       { .compatible = "microchip,mrf24j40mc", .data = (void *)MRF24J40MC },
+       { },
+};
+MODULE_DEVICE_TABLE(of, mrf24j40_of_match);
+
 static const struct spi_device_id mrf24j40_ids[] = {
        { "mrf24j40", MRF24J40 },
        { "mrf24j40ma", MRF24J40MA },
@@ -809,6 +817,7 @@ MODULE_DEVICE_TABLE(spi, mrf24j40_ids);
 
 static struct spi_driver mrf24j40_driver = {
        .driver = {
+               .of_match_table = of_match_ptr(mrf24j40_of_match),
                .name = "mrf24j40",
                .owner = THIS_MODULE,
        },