[RFC PATCH 09/14] ARM: ARM flash driver DT port

Lorenzo Pieralisi lorenzo.pieralisi at arm.com
Thu Aug 19 04:59:55 EST 2010


When OF is enabled drivers should initialize the driver match table
to allow the kernel to find and recognise drivers suitable for
devices. The initialization is carried out through a static inline
function at driver init time.

This patch adds a match table and relative init code to support
device tree probing methodology for the ARM flash driver.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi at arm.com>
---
 drivers/mtd/maps/integrator-flash.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c
index 2aac41b..aa9a556 100644
--- a/drivers/mtd/maps/integrator-flash.c
+++ b/drivers/mtd/maps/integrator-flash.c
@@ -291,6 +291,11 @@ static int armflash_remove(struct platform_device *dev)
 	return 0;
 }
 
+static struct of_device_id armflash_matches[] = {
+	{ .compatible = "arm,arm-flash"},
+	{},
+};
+
 static struct platform_driver armflash_driver = {
 	.probe		= armflash_probe,
 	.remove		= armflash_remove,
@@ -302,6 +307,7 @@ static struct platform_driver armflash_driver = {
 
 static int __init armflash_init(void)
 {
+	platform_init_match(&armflash_driver, armflash_matches);
 	return platform_driver_register(&armflash_driver);
 }
 
-- 
1.6.3.3



More information about the devicetree-discuss mailing list