Re: [RFC PATCH 01/10] OMAP2+: l3-noc: Add support for device-tree

From
Grant Likely <hidden>
Date
2011-09-08 18:01:48
Also in
linux-arm-kernel, linux-omap
Reply to
Benoit Cousson, 2011-08-24
On Wed, Aug 24, 2011 at 03:09:07PM +0200, Benoit Cousson wrote:
quoted hunk ↗ jump to hunk
Add device-tree support for the l3-noc driver.

Use platform_driver_register to defer the probing at device init
time.

Signed-off-by: Benoit Cousson <redacted>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Santosh Shilimkar <redacted>
---
 arch/arm/mach-omap2/omap_l3_noc.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_l3_noc.c b/arch/arm/mach-omap2/omap_l3_noc.c
index 7b9f190..4630703 100644
--- a/arch/arm/mach-omap2/omap_l3_noc.c
+++ b/arch/arm/mach-omap2/omap_l3_noc.c
@@ -228,16 +228,28 @@ static int __exit omap4_l3_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#if defined(CONFIG_OF)
+static const struct of_device_id l3_noc_match[] = {
+	{.compatible = "arteris,noc", },
Missing documentation for this compatible property.  Also, it appears
to be rather on the generic side.
quoted hunk ↗ jump to hunk
+	{},
+}
+MODULE_DEVICE_TABLE(of, l3_noc_match);
+#else
+#define l3_noc_match NULL
+#endif
+
 static struct platform_driver omap4_l3_driver = {
+	.probe		= omap4_l3_probe,
.probe needs to be put into the __devinit section.
 	.remove		= __exit_p(omap4_l3_remove),
Similarly, at the same time the remove hook should be changed to
__devexit and __devexit_p() at the same time.
quoted hunk ↗ jump to hunk
 	.driver		= {
-	.name		= "omap_l3_noc",
+		.name		= "omap_l3_noc",
+		.of_match_table = l3_noc_match,
Looks like ".owner = THIS_MODULE," is missing too.
 	},
 };
 
 static int __init omap4_l3_init(void)
 {
-	return platform_driver_probe(&omap4_l3_driver, omap4_l3_probe);
+	return platform_driver_register(&omap4_l3_driver);
 }
 postcore_initcall_sync(omap4_l3_init);
 
-- 
1.7.0.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (2 messages) 2 messages, 2 authors, last reply 2011-09-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help