120-platform.patch 1.8 KB

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