120-platform.patch 1.9 KB

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