1
1
openwrt/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch
Rosen Penev 7116f3cd00 lantiq: remove old kernel fixes
No longer needed.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22949
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-25 00:55:12 +02:00

72 lines
1.8 KiB
Diff

--- a/src/common/drv_dsl_cpe_os_linux.c
+++ b/src/common/drv_dsl_cpe_os_linux.c
@@ -11,7 +11,8 @@
#ifdef __LINUX__
#define DSL_INTERN
-#include <linux/device.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
#include "drv_dsl_cpe_api.h"
#include "drv_dsl_cpe_api_ioctl.h"
@@ -1058,7 +1059,7 @@ static void DSL_DRV_DebugInit(void)
#endif
/* Entry point of driver */
-int __init DSL_ModuleInit(void)
+static int ltq_adsl_probe(struct platform_device *pdev)
{
struct class *dsl_class;
DSL_int_t i;
@@ -1112,7 +1113,7 @@ int __init DSL_ModuleInit(void)
return 0;
}
-void __exit DSL_ModuleCleanup(void)
+static void ltq_adsl_remove(struct platform_device *pdev)
{
printk("Module will be unloaded"DSL_DRV_CRLF);
@@ -1126,8 +1127,6 @@ void __exit DSL_ModuleCleanup(void)
DSL_FPGA_BND_REGS_SZ_BYTE,
(DSL_uint8_t**)&g_BndFpgaBase);
#endif /* defined(INCLUDE_DSL_CPE_API_VINAX) && defined(INCLUDE_DSL_BONDING)*/
-
- return;
}
#ifndef _lint
@@ -1143,8 +1142,29 @@ module_param(debug_level, byte, 0);
MODULE_PARM_DESC(debug_level, "set to get more (1) or fewer (4) debug outputs");
#endif /* #ifndef DSL_DEBUG_DISABLE*/
-module_init(DSL_ModuleInit);
-module_exit(DSL_ModuleCleanup);
+static const struct of_device_id ltq_adsl_match[] = {
+#ifdef CONFIG_DANUBE
+ { .compatible = "lantiq,adsl-danube"},
+#elif defined CONFIG_AMAZON_SE
+ { .compatible = "lantiq,adsl-ase"},
+#elif defined CONFIG_AR9
+ { .compatible = "lantiq,adsl-arx100"},
+#endif
+ {},
+};
+MODULE_DEVICE_TABLE(of, ltq_adsl_match);
+
+static struct platform_driver ltq_adsl_driver = {
+ .probe = ltq_adsl_probe,
+ .remove = ltq_adsl_remove,
+ .driver = {
+ .name = "adsl",
+ .of_match_table = ltq_adsl_match,
+ },
+};
+
+module_platform_driver(ltq_adsl_driver);
+
#endif /* #ifndef _lint*/
//EXPORT_SYMBOL(DSL_ModuleInit);