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 <[email protected]>
---
 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

_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

Reply via email to