[PATCH 1/8] mtd: m25p80: add devicetree support

Sascha Hauer s.hauer at pengutronix.de
Thu May 30 07:49:20 EDT 2013


Until we have spi device_id support match to "m25p80" for now.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/mtd/devices/m25p80.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 048d178..57fe1f2 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -947,9 +947,18 @@ static int m25p_probe(struct device_d *dev)
 	return add_mtd_device(&flash->mtd, flash->mtd.name);
 }
 
+static __maybe_unused struct of_device_id m25p80_dt_ids[] = {
+	{
+		.compatible = "m25p80",
+	}, {
+		/* sentinel */
+	}
+};
+
 static struct driver_d m25p80_driver = {
 	.name	= "m25p80",
 	.probe	= m25p_probe,
+	.of_compatible = DRV_OF_COMPAT(m25p80_dt_ids),
 };
 device_spi_driver(m25p80_driver);
 
-- 
1.8.2.rc2




More information about the barebox mailing list