1 --- a/src/common/drv_dsl_cpe_os_linux.c
2 +++ b/src/common/drv_dsl_cpe_os_linux.c
7 -#include <linux/device.h>
8 +#include <linux/of_platform.h>
10 #include "drv_dsl_cpe_api.h"
11 #include "drv_dsl_cpe_api_ioctl.h"
12 @@ -1070,7 +1070,7 @@ static void DSL_DRV_DebugInit(void)
15 /* Entry point of driver */
16 -int __init DSL_ModuleInit(void)
17 +static int __devinit ltq_adsl_probe(struct platform_device *pdev)
19 struct class *dsl_class;
21 @@ -1124,7 +1124,7 @@ int __init DSL_ModuleInit(void)
25 -void __exit DSL_ModuleCleanup(void)
26 +static int __devexit ltq_adsl_remove(struct platform_device *pdev)
28 printk("Module will be unloaded"DSL_DRV_CRLF);
30 @@ -1139,7 +1139,7 @@ void __exit DSL_ModuleCleanup(void)
31 (DSL_uint8_t**)&g_BndFpgaBase);
32 #endif /* defined(INCLUDE_DSL_CPE_API_VINAX) && defined(INCLUDE_DSL_BONDING)*/
39 @@ -1155,8 +1155,30 @@ module_param(debug_level, byte, 0);
40 MODULE_PARM_DESC(debug_level, "set to get more (1) or fewer (4) debug outputs");
41 #endif /* #ifndef DSL_DEBUG_DISABLE*/
43 -module_init(DSL_ModuleInit);
44 -module_exit(DSL_ModuleCleanup);
45 +static const struct of_device_id ltq_adsl_match[] = {
47 + { .compatible = "lantiq,adsl-danube"},
48 +#elif defined CONFIG_AMAZON_SE
49 + { .compatible = "lantiq,adsl-ase"},
50 +#elif defined CONFIG_AR9
51 + { .compatible = "lantiq,adsl-arx100"},
55 +MODULE_DEVICE_TABLE(of, ltq_adsl_match);
57 +static struct platform_driver ltq_adsl_driver = {
58 + .probe = ltq_adsl_probe,
59 + .remove = __devexit_p(ltq_adsl_remove),
62 + .owner = THIS_MODULE,
63 + .of_match_table = ltq_adsl_match,
67 +module_platform_driver(ltq_adsl_driver);
69 #endif /* #ifndef _lint*/
71 //EXPORT_SYMBOL(DSL_ModuleInit);