X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fstaging%2Fwigyori.git;a=blobdiff_plain;f=package%2Fkernel%2Flantiq%2Fltq-ptm%2Fsrc%2Fifxmips_ptm_adsl.c;h=186c848693f975edbf68e2762eb2e3df08b62618;hp=43e171a2b4f216aa9935de6ef87e8b7e461f3338;hb=ff3cfe084885662843a6cc95a547eb9f8ef48fa5;hpb=eae6cac6a30b95bef04d033ed8a303b7e35a078b diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c index 43e171a2b4..186c848693 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c @@ -44,6 +44,8 @@ #include #include #include +#include +#include #include /* @@ -1448,6 +1450,19 @@ static int ptm_showtime_exit(void) } +static const struct of_device_id ltq_ptm_match[] = { +#ifdef CONFIG_DANUBE + { .compatible = "lantiq,ppe-danube", .data = NULL }, +#elif defined CONFIG_AMAZON_SE + { .compatible = "lantiq,ppe-ase", .data = NULL }, +#elif defined CONFIG_AR9 + { .compatible = "lantiq,ppe-arx100", .data = NULL }, +#elif defined CONFIG_VR9 + { .compatible = "lantiq,ppe-xrx200", .data = NULL }, +#endif + {}, +}; +MODULE_DEVICE_TABLE(of, ltq_ptm_match); /* * #################################### @@ -1465,7 +1480,7 @@ static int ptm_showtime_exit(void) * 0 --- successful * else --- failure, usually it is negative value of error code */ -static int ifx_ptm_init(void) +static int ltq_ptm_probe(struct platform_device *pdev) { int ret; struct port_cell_info port_cell = {0}; @@ -1481,7 +1496,7 @@ static int ifx_ptm_init(void) goto INIT_PRIV_DATA_FAIL; } - ifx_ptm_init_chip(); + ifx_ptm_init_chip(pdev); init_tables(); for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) { @@ -1570,7 +1585,7 @@ INIT_PRIV_DATA_FAIL: * Output: * none */ -static void __exit ifx_ptm_exit(void) +static int ltq_ptm_remove(struct platform_device *pdev) { int i; @@ -1595,7 +1610,20 @@ static void __exit ifx_ptm_exit(void) ifx_ptm_uninit_chip(); clear_priv_data(); + + return 0; } -module_init(ifx_ptm_init); -module_exit(ifx_ptm_exit); +static struct platform_driver ltq_ptm_driver = { + .probe = ltq_ptm_probe, + .remove = ltq_ptm_remove, + .driver = { + .name = "ptm", + .owner = THIS_MODULE, + .of_match_table = ltq_ptm_match, + }, +}; + +module_platform_driver(ltq_ptm_driver); + +MODULE_LICENSE("GPL");