diff options
-rw-r--r-- | arch/arm/boot/dts/omap3.dtsi | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 2 | ||||
-rw-r--r-- | drivers/bus/omap_l3_smx.c | 26 |
3 files changed, 23 insertions, 7 deletions
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index d0e884d3a737..e602e75ce5b7 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi | |||
@@ -79,7 +79,7 @@ | |||
79 | * hierarchy. | 79 | * hierarchy. |
80 | */ | 80 | */ |
81 | ocp { | 81 | ocp { |
82 | compatible = "simple-bus"; | 82 | compatible = "ti,omap3-l3-smx", "simple-bus"; |
83 | reg = <0x68000000 0x10000>; | 83 | reg = <0x68000000 0x10000>; |
84 | interrupts = <9 10>; | 84 | interrupts = <9 10>; |
85 | #address-cells = <1>; | 85 | #address-cells = <1>; |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 324f02bf8a51..55447972eeed 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -49,7 +49,7 @@ static int __init omap3_l3_init(void) | |||
49 | * To avoid code running on other OMAPs in | 49 | * To avoid code running on other OMAPs in |
50 | * multi-omap builds | 50 | * multi-omap builds |
51 | */ | 51 | */ |
52 | if (!(cpu_is_omap34xx())) | 52 | if (!(cpu_is_omap34xx()) || of_have_populated_dt()) |
53 | return -ENODEV; | 53 | return -ENODEV; |
54 | 54 | ||
55 | snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main"); | 55 | snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main"); |
diff --git a/drivers/bus/omap_l3_smx.c b/drivers/bus/omap_l3_smx.c index acc216491b8a..597fdaee7315 100644 --- a/drivers/bus/omap_l3_smx.c +++ b/drivers/bus/omap_l3_smx.c | |||
@@ -27,6 +27,10 @@ | |||
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | #include <linux/module.h> | ||
31 | #include <linux/of.h> | ||
32 | #include <linux/of_device.h> | ||
33 | |||
30 | #include "omap_l3_smx.h" | 34 | #include "omap_l3_smx.h" |
31 | 35 | ||
32 | static inline u64 omap3_l3_readll(void __iomem *base, u16 reg) | 36 | static inline u64 omap3_l3_readll(void __iomem *base, u16 reg) |
@@ -211,7 +215,17 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) | |||
211 | return ret; | 215 | return ret; |
212 | } | 216 | } |
213 | 217 | ||
214 | static int __init omap3_l3_probe(struct platform_device *pdev) | 218 | #if IS_BUILTIN(CONFIG_OF) |
219 | static const struct of_device_id omap3_l3_match[] = { | ||
220 | { | ||
221 | .compatible = "ti,omap3-l3-smx", | ||
222 | }, | ||
223 | { }, | ||
224 | }; | ||
225 | MODULE_DEVICE_TABLE(of, omap3_l3_match); | ||
226 | #endif | ||
227 | |||
228 | static int omap3_l3_probe(struct platform_device *pdev) | ||
215 | { | 229 | { |
216 | struct omap3_l3 *l3; | 230 | struct omap3_l3 *l3; |
217 | struct resource *res; | 231 | struct resource *res; |
@@ -265,7 +279,7 @@ err0: | |||
265 | return ret; | 279 | return ret; |
266 | } | 280 | } |
267 | 281 | ||
268 | static int __exit omap3_l3_remove(struct platform_device *pdev) | 282 | static int omap3_l3_remove(struct platform_device *pdev) |
269 | { | 283 | { |
270 | struct omap3_l3 *l3 = platform_get_drvdata(pdev); | 284 | struct omap3_l3 *l3 = platform_get_drvdata(pdev); |
271 | 285 | ||
@@ -278,15 +292,17 @@ static int __exit omap3_l3_remove(struct platform_device *pdev) | |||
278 | } | 292 | } |
279 | 293 | ||
280 | static struct platform_driver omap3_l3_driver = { | 294 | static struct platform_driver omap3_l3_driver = { |
281 | .remove = __exit_p(omap3_l3_remove), | 295 | .probe = omap3_l3_probe, |
296 | .remove = omap3_l3_remove, | ||
282 | .driver = { | 297 | .driver = { |
283 | .name = "omap_l3_smx", | 298 | .name = "omap_l3_smx", |
299 | .of_match_table = of_match_ptr(omap3_l3_match), | ||
284 | }, | 300 | }, |
285 | }; | 301 | }; |
286 | 302 | ||
287 | static int __init omap3_l3_init(void) | 303 | static int __init omap3_l3_init(void) |
288 | { | 304 | { |
289 | return platform_driver_probe(&omap3_l3_driver, omap3_l3_probe); | 305 | return platform_driver_register(&omap3_l3_driver); |
290 | } | 306 | } |
291 | postcore_initcall_sync(omap3_l3_init); | 307 | postcore_initcall_sync(omap3_l3_init); |
292 | 308 | ||