| 1 | Index: drv_dsl_cpe_api-3.24.4.4/src/common/drv_dsl_cpe_os_linux.c |
| 2 | =================================================================== |
| 3 | --- drv_dsl_cpe_api-3.24.4.4.orig/src/common/drv_dsl_cpe_os_linux.c 2012-12-07 21:22:58.020256076 +0100 |
| 4 | +++ drv_dsl_cpe_api-3.24.4.4/src/common/drv_dsl_cpe_os_linux.c 2012-12-07 21:31:13.156268489 +0100 |
| 5 | @@ -12,6 +12,7 @@ |
| 6 | |
| 7 | #define DSL_INTERN |
| 8 | #include <linux/device.h> |
| 9 | +#include <linux/platform_device.h> |
| 10 | |
| 11 | #include "drv_dsl_cpe_api.h" |
| 12 | #include "drv_dsl_cpe_api_ioctl.h" |
| 13 | @@ -1063,7 +1064,7 @@ |
| 14 | #endif |
| 15 | |
| 16 | /* Entry point of driver */ |
| 17 | -int __init DSL_ModuleInit(void) |
| 18 | +static int __devinit ltq_adsl_probe(struct platform_device *pdev) |
| 19 | { |
| 20 | struct class *dsl_class; |
| 21 | DSL_int_t i; |
| 22 | @@ -1117,7 +1118,7 @@ |
| 23 | return 0; |
| 24 | } |
| 25 | |
| 26 | -void __exit DSL_ModuleCleanup(void) |
| 27 | +static int __devexit ltq_adsl_remove(struct platform_device *pdev) |
| 28 | { |
| 29 | printk("Module will be unloaded"DSL_DRV_CRLF); |
| 30 | |
| 31 | @@ -1132,7 +1133,7 @@ |
| 32 | (DSL_uint8_t**)&g_BndFpgaBase); |
| 33 | #endif /* defined(INCLUDE_DSL_CPE_API_VINAX) && defined(INCLUDE_DSL_BONDING)*/ |
| 34 | |
| 35 | - return; |
| 36 | + return 0; |
| 37 | } |
| 38 | |
| 39 | #ifndef _lint |
| 40 | @@ -1148,8 +1149,30 @@ |
| 41 | MODULE_PARM_DESC(debug_level, "set to get more (1) or fewer (4) debug outputs"); |
| 42 | #endif /* #ifndef DSL_DEBUG_DISABLE*/ |
| 43 | |
| 44 | -module_init(DSL_ModuleInit); |
| 45 | -module_exit(DSL_ModuleCleanup); |
| 46 | +static const struct of_device_id ltq_adsl_match[] = { |
| 47 | +#ifdef CONFIG_DANUBE |
| 48 | + { .compatible = "lantiq,adsl-danube"}, |
| 49 | +#elif defined CONFIG_AMAZON_SE |
| 50 | + { .compatible = "lantiq,adsl-ase"}, |
| 51 | +#elif defined CONFIG_AR9 |
| 52 | + { .compatible = "lantiq,adsl-arx100"}, |
| 53 | +#endif |
| 54 | + {}, |
| 55 | +}; |
| 56 | +MODULE_DEVICE_TABLE(of, ltq_adsl_match); |
| 57 | + |
| 58 | +static struct platform_driver ltq_adsl_driver = { |
| 59 | + .probe = ltq_adsl_probe, |
| 60 | + .remove = __devexit_p(ltq_adsl_remove), |
| 61 | + .driver = { |
| 62 | + .name = "adsl", |
| 63 | + .owner = THIS_MODULE, |
| 64 | + .of_match_table = ltq_adsl_match, |
| 65 | + }, |
| 66 | +}; |
| 67 | + |
| 68 | +module_platform_driver(ltq_adsl_driver); |
| 69 | + |
| 70 | #endif /* #ifndef _lint*/ |
| 71 | |
| 72 | //EXPORT_SYMBOL(DSL_ModuleInit); |
| 73 | |