* [PATCH 1/3] MIPS: lantiq: unify xway prom code
@ 2012-02-17 10:33 John Crispin
2012-02-17 10:33 ` [PATCH 2/3] MIPS: lantiq: add vr9 support John Crispin
2012-02-17 10:33 ` [PATCH 3/3] MIPS: lantiq: make use of module_platform_driver() John Crispin
0 siblings, 2 replies; 6+ messages in thread
From: John Crispin @ 2012-02-17 10:33 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, John Crispin
The xway prom-ase.c and prom-xway.c files are redundant. Unify the 2 files.
Signed-off-by: John Crispin <blogic@openwrt.org>
---
arch/mips/lantiq/xway/Makefile | 5 +--
arch/mips/lantiq/xway/prom-ase.c | 48 ----------------------
arch/mips/lantiq/xway/prom-xway.c | 64 ------------------------------
arch/mips/lantiq/xway/prom.c | 79 +++++++++++++++++++++++++++++++++++++
4 files changed, 80 insertions(+), 116 deletions(-)
delete mode 100644 arch/mips/lantiq/xway/prom-ase.c
delete mode 100644 arch/mips/lantiq/xway/prom-xway.c
create mode 100644 arch/mips/lantiq/xway/prom.c
diff --git a/arch/mips/lantiq/xway/Makefile b/arch/mips/lantiq/xway/Makefile
index 4dcb96f..89f0a11 100644
--- a/arch/mips/lantiq/xway/Makefile
+++ b/arch/mips/lantiq/xway/Makefile
@@ -1,7 +1,4 @@
-obj-y := sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o clk.o
-
-obj-$(CONFIG_SOC_XWAY) += prom-xway.o
-obj-$(CONFIG_SOC_AMAZON_SE) += prom-ase.o
+obj-y := prom.o sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o clk.o
obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o
obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o
diff --git a/arch/mips/lantiq/xway/prom-ase.c b/arch/mips/lantiq/xway/prom-ase.c
deleted file mode 100644
index 3f86a3b..0000000
--- a/arch/mips/lantiq/xway/prom-ase.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
- */
-
-#include <linux/export.h>
-#include <linux/clk.h>
-#include <asm/bootinfo.h>
-#include <asm/time.h>
-
-#include <lantiq_soc.h>
-
-#include "devices.h"
-#include "../prom.h"
-
-#define SOC_AMAZON_SE "Amazon_SE"
-
-#define PART_SHIFT 12
-#define PART_MASK 0x0FFFFFFF
-#define REV_SHIFT 28
-#define REV_MASK 0xF0000000
-
-void __init ltq_soc_detect(struct ltq_soc_info *i)
-{
- i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
- i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
- sprintf(i->rev_type, "1.%d", i->rev);
- switch (i->partnum) {
- case SOC_ID_AMAZON_SE:
- i->name = SOC_AMAZON_SE;
- i->type = SOC_TYPE_AMAZON_SE;
- break;
-
- default:
- unreachable();
- break;
- }
-}
-
-void __init ltq_soc_setup(void)
-{
- ltq_register_ase_asc();
- ltq_register_gpio();
- ltq_register_wdt();
-}
diff --git a/arch/mips/lantiq/xway/prom-xway.c b/arch/mips/lantiq/xway/prom-xway.c
deleted file mode 100644
index d823a92..0000000
--- a/arch/mips/lantiq/xway/prom-xway.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
- */
-
-#include <linux/export.h>
-#include <linux/clk.h>
-#include <asm/bootinfo.h>
-#include <asm/time.h>
-
-#include <lantiq_soc.h>
-
-#include "devices.h"
-#include "../prom.h"
-
-#define SOC_DANUBE "Danube"
-#define SOC_TWINPASS "Twinpass"
-#define SOC_AR9 "AR9"
-
-#define PART_SHIFT 12
-#define PART_MASK 0x0FFFFFFF
-#define REV_SHIFT 28
-#define REV_MASK 0xF0000000
-
-void __init ltq_soc_detect(struct ltq_soc_info *i)
-{
- i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
- i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
- sprintf(i->rev_type, "1.%d", i->rev);
- switch (i->partnum) {
- case SOC_ID_DANUBE1:
- case SOC_ID_DANUBE2:
- i->name = SOC_DANUBE;
- i->type = SOC_TYPE_DANUBE;
- break;
-
- case SOC_ID_TWINPASS:
- i->name = SOC_TWINPASS;
- i->type = SOC_TYPE_DANUBE;
- break;
-
- case SOC_ID_ARX188:
- case SOC_ID_ARX168:
- case SOC_ID_ARX182:
- i->name = SOC_AR9;
- i->type = SOC_TYPE_AR9;
- break;
-
- default:
- unreachable();
- break;
- }
-}
-
-void __init ltq_soc_setup(void)
-{
- ltq_register_asc(0);
- ltq_register_asc(1);
- ltq_register_gpio();
- ltq_register_wdt();
-}
diff --git a/arch/mips/lantiq/xway/prom.c b/arch/mips/lantiq/xway/prom.c
new file mode 100644
index 0000000..0929acb
--- /dev/null
+++ b/arch/mips/lantiq/xway/prom.c
@@ -0,0 +1,79 @@
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
+ */
+
+#include <linux/export.h>
+#include <linux/clk.h>
+#include <asm/bootinfo.h>
+#include <asm/time.h>
+
+#include <lantiq_soc.h>
+
+#include "../prom.h"
+#include "devices.h"
+
+#define SOC_DANUBE "Danube"
+#define SOC_TWINPASS "Twinpass"
+#define SOC_AR9 "AR9"
+#define SOC_VR9 "VR9"
+
+#define PART_SHIFT 12
+#define PART_MASK 0x0FFFFFFF
+#define REV_SHIFT 28
+#define REV_MASK 0xF0000000
+
+#define SOC_AMAZON_SE "Amazon_SE"
+
+void __init ltq_soc_detect(struct ltq_soc_info *i)
+{
+ i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
+ i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
+ sprintf(i->rev_type, "1.%d", i->rev);
+ switch (i->partnum) {
+ case SOC_ID_DANUBE1:
+ case SOC_ID_DANUBE2:
+ i->name = SOC_DANUBE;
+ i->type = SOC_TYPE_DANUBE;
+ break;
+
+ case SOC_ID_TWINPASS:
+ i->name = SOC_TWINPASS;
+ i->type = SOC_TYPE_DANUBE;
+ break;
+
+ case SOC_ID_ARX188:
+ case SOC_ID_ARX168:
+ case SOC_ID_ARX182:
+ i->name = SOC_AR9;
+ i->type = SOC_TYPE_AR9;
+ break;
+
+ case SOC_ID_AMAZON_SE:
+ i->name = SOC_AMAZON_SE;
+ i->type = SOC_TYPE_AMAZON_SE;
+#ifdef CONFIG_PCI
+ panic("ase is only supported for non pci kernels");
+#endif
+ break;
+
+ default:
+ unreachable();
+ break;
+ }
+}
+
+void __init ltq_soc_setup(void)
+{
+ if (ltq_is_ase()) {
+ ltq_register_ase_asc();
+ } else {
+ ltq_register_asc(0);
+ ltq_register_asc(1);
+ }
+ ltq_register_gpio();
+ ltq_register_wdt();
+}
--
1.7.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] MIPS: lantiq: add vr9 support
2012-02-17 10:33 [PATCH 1/3] MIPS: lantiq: unify xway prom code John Crispin
@ 2012-02-17 10:33 ` John Crispin
2012-02-17 17:43 ` Sergei Shtylyov
2012-02-17 10:33 ` [PATCH 3/3] MIPS: lantiq: make use of module_platform_driver() John Crispin
1 sibling, 1 reply; 6+ messages in thread
From: John Crispin @ 2012-02-17 10:33 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, John Crispin
VR9 is a VDSL SoC made by Lantiq. It is very similar to the AR9.
This patch adds the clkdev init code and SoC detection for the VR9.
Signed-off-by: John Crispin <blogic@openwrt.org>
---
.../mips/include/asm/mach-lantiq/xway/lantiq_soc.h | 1 +
arch/mips/lantiq/xway/prom.c | 5 +++++
arch/mips/lantiq/xway/sysctrl.c | 10 ++++++++++
3 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
index 6dfb65e..8e0fa6c 100644
--- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
+++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
@@ -21,6 +21,7 @@
#define SOC_ID_ARX188 0x16C
#define SOC_ID_ARX168 0x16D
#define SOC_ID_ARX182 0x16F
+#define SOC_ID_VRX288 0x1C0
/* SoC Types */
#define SOC_TYPE_DANUBE 0x01
diff --git a/arch/mips/lantiq/xway/prom.c b/arch/mips/lantiq/xway/prom.c
index 0929acb..53b627c 100644
--- a/arch/mips/lantiq/xway/prom.c
+++ b/arch/mips/lantiq/xway/prom.c
@@ -60,6 +60,11 @@ void __init ltq_soc_detect(struct ltq_soc_info *i)
#endif
break;
+ case SOC_ID_VRX288:
+ i->name = SOC_VR9;
+ i->type = SOC_TYPE_VR9;
+ break;
+
default:
unreachable();
break;
diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c
index 879c89a..18bff5a 100644
--- a/arch/mips/lantiq/xway/sysctrl.c
+++ b/arch/mips/lantiq/xway/sysctrl.c
@@ -152,6 +152,16 @@ void __init ltq_soc_init(void)
clkdev_add_static("io", CLOCK_133M);
clkdev_add_cgu("ephycgu", CGU_EPHY),
clkdev_add_pmu("fpi", "ephy", 0, PMU_EPHY);
+ } else if (ltq_is_vr9()) {
+ clkdev_add_static("cpu", ltq_vr9_cpu_hz());
+ clkdev_add_static("fpi", ltq_vr9_fpi_hz());
+ clkdev_add_static("io", ltq_vr9_io_region_clock());
+ clkdev_add_pmu("pcie-phy", NULL, 1, PMU1_PCIE_PHY);
+ clkdev_add_pmu("pcie-bus", NULL, 0, PMU_PCIE_CLK);
+ clkdev_add_pmu("pcie-msi", NULL, 1, PMU1_PCIE_MSI);
+ clkdev_add_pmu("pcie-pdi", NULL, 1, PMU1_PCIE_PDI);
+ clkdev_add_pmu("pcie-ctl", NULL, 1, PMU1_PCIE_CTL);
+ clkdev_add_pmu("ahb", NULL, 0, PMU_AHBM | PMU_AHBS);
} else {
clkdev_add_static("cpu", ltq_danube_cpu_hz());
clkdev_add_static("fpi", ltq_danube_fpi_hz());
--
1.7.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] MIPS: lantiq: make use of module_platform_driver()
2012-02-17 10:33 [PATCH 1/3] MIPS: lantiq: unify xway prom code John Crispin
2012-02-17 10:33 ` [PATCH 2/3] MIPS: lantiq: add vr9 support John Crispin
@ 2012-02-17 10:33 ` John Crispin
2012-02-17 23:02 ` Daniel Schwierzeck
1 sibling, 1 reply; 6+ messages in thread
From: John Crispin @ 2012-02-17 10:33 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, John Crispin
Reduce boilerplate code.
Signed-off-by: John Crispin <blogic@openwrt.org>
---
drivers/mtd/maps/lantiq-flash.c | 20 ++------------------
drivers/net/ethernet/lantiq_etop.c | 20 ++------------------
drivers/watchdog/lantiq_wdt.c | 17 ++---------------
3 files changed, 6 insertions(+), 51 deletions(-)
diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c
index 7b889de..e22436d 100644
--- a/drivers/mtd/maps/lantiq-flash.c
+++ b/drivers/mtd/maps/lantiq-flash.c
@@ -203,6 +203,7 @@ ltq_mtd_remove(struct platform_device *pdev)
}
static struct platform_driver ltq_mtd_driver = {
+ .probe = ltq_mtd_probe,
.remove = __devexit_p(ltq_mtd_remove),
.driver = {
.name = "ltq_nor",
@@ -210,24 +211,7 @@ static struct platform_driver ltq_mtd_driver = {
},
};
-static int __init
-init_ltq_mtd(void)
-{
- int ret = platform_driver_probe(<q_mtd_driver, ltq_mtd_probe);
-
- if (ret)
- pr_err("ltq_nor: error registering platform driver");
- return ret;
-}
-
-static void __exit
-exit_ltq_mtd(void)
-{
- platform_driver_unregister(<q_mtd_driver);
-}
-
-module_init(init_ltq_mtd);
-module_exit(exit_ltq_mtd);
+module_platform_driver(ltq_mtd_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index fa2580b..4cfc314 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -943,6 +943,7 @@ ltq_etop_remove(struct platform_device *pdev)
}
static struct platform_driver ltq_mii_driver = {
+ .probe = ltq_etop_probe,
.remove = __devexit_p(ltq_etop_remove),
.driver = {
.name = "ltq_etop",
@@ -950,24 +951,7 @@ static struct platform_driver ltq_mii_driver = {
},
};
-int __init
-init_ltq_etop(void)
-{
- int ret = platform_driver_probe(<q_mii_driver, ltq_etop_probe);
-
- if (ret)
- pr_err("ltq_etop: Error registering platfom driver!");
- return ret;
-}
-
-static void __exit
-exit_ltq_etop(void)
-{
- platform_driver_unregister(<q_mii_driver);
-}
-
-module_init(init_ltq_etop);
-module_exit(exit_ltq_etop);
+module_platform_driver(ltq_mii_driver);
MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
MODULE_DESCRIPTION("Lantiq SoC ETOP");
diff --git a/drivers/watchdog/lantiq_wdt.c b/drivers/watchdog/lantiq_wdt.c
index 05646b8..572ac60 100644
--- a/drivers/watchdog/lantiq_wdt.c
+++ b/drivers/watchdog/lantiq_wdt.c
@@ -227,6 +227,7 @@ ltq_wdt_remove(struct platform_device *pdev)
static struct platform_driver ltq_wdt_driver = {
+ .probe = ltq_wdt_probe,
.remove = __devexit_p(ltq_wdt_remove),
.driver = {
.name = "ltq_wdt",
@@ -234,21 +235,7 @@ static struct platform_driver ltq_wdt_driver = {
},
};
-static int __init
-init_ltq_wdt(void)
-{
- return platform_driver_probe(<q_wdt_driver, ltq_wdt_probe);
-}
-
-static void __exit
-exit_ltq_wdt(void)
-{
- return platform_driver_unregister(<q_wdt_driver);
-}
-
-module_init(init_ltq_wdt);
-module_exit(exit_ltq_wdt);
-
+module_platform_driver(ltq_wdt_driver);
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
--
1.7.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] MIPS: lantiq: add vr9 support
2012-02-17 17:43 ` Sergei Shtylyov
@ 2012-02-17 16:50 ` John Crispin
0 siblings, 0 replies; 6+ messages in thread
From: John Crispin @ 2012-02-17 16:50 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: Ralf Baechle, linux-mips
>> +#define SOC_ID_VRX288 0x1C0
>
> Use tabs to indent the value as above.
>
i would have expected checkpatch.pl to complain about this one ?!
>> + } else if (ltq_is_vr9()) {
>
> Where is this defined?
>
was added around 3.1 with the rest of the soc detection code.
you can find it in arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
thx,
John
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] MIPS: lantiq: add vr9 support
2012-02-17 10:33 ` [PATCH 2/3] MIPS: lantiq: add vr9 support John Crispin
@ 2012-02-17 17:43 ` Sergei Shtylyov
2012-02-17 16:50 ` John Crispin
0 siblings, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2012-02-17 17:43 UTC (permalink / raw)
To: John Crispin; +Cc: Ralf Baechle, linux-mips
Hello.
On 02/17/2012 01:33 PM, John Crispin wrote:
> VR9 is a VDSL SoC made by Lantiq. It is very similar to the AR9.
> This patch adds the clkdev init code and SoC detection for the VR9.
> Signed-off-by: John Crispin<blogic@openwrt.org>
> ---
> .../mips/include/asm/mach-lantiq/xway/lantiq_soc.h | 1 +
> arch/mips/lantiq/xway/prom.c | 5 +++++
> arch/mips/lantiq/xway/sysctrl.c | 10 ++++++++++
> 3 files changed, 16 insertions(+), 0 deletions(-)
> diff --git a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
> index 6dfb65e..8e0fa6c 100644
> --- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
> +++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
> @@ -21,6 +21,7 @@
> #define SOC_ID_ARX188 0x16C
> #define SOC_ID_ARX168 0x16D
> #define SOC_ID_ARX182 0x16F
> +#define SOC_ID_VRX288 0x1C0
Use tabs to indent the value as above.
> diff --git a/arch/mips/lantiq/xway/prom.c b/arch/mips/lantiq/xway/prom.c
> index 0929acb..53b627c 100644
> --- a/arch/mips/lantiq/xway/prom.c
> +++ b/arch/mips/lantiq/xway/prom.c
> @@ -60,6 +60,11 @@ void __init ltq_soc_detect(struct ltq_soc_info *i)
> #endif
> break;
>
> + case SOC_ID_VRX288:
> + i->name = SOC_VR9;
> + i->type = SOC_TYPE_VR9;
> + break;
> +
> default:
> unreachable();
> break;
> diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c
> index 879c89a..18bff5a 100644
> --- a/arch/mips/lantiq/xway/sysctrl.c
> +++ b/arch/mips/lantiq/xway/sysctrl.c
> @@ -152,6 +152,16 @@ void __init ltq_soc_init(void)
> clkdev_add_static("io", CLOCK_133M);
> clkdev_add_cgu("ephycgu", CGU_EPHY),
> clkdev_add_pmu("fpi", "ephy", 0, PMU_EPHY);
> + } else if (ltq_is_vr9()) {
Where is this defined?
> + clkdev_add_static("cpu", ltq_vr9_cpu_hz());
> + clkdev_add_static("fpi", ltq_vr9_fpi_hz());
> + clkdev_add_static("io", ltq_vr9_io_region_clock());
> + clkdev_add_pmu("pcie-phy", NULL, 1, PMU1_PCIE_PHY);
> + clkdev_add_pmu("pcie-bus", NULL, 0, PMU_PCIE_CLK);
> + clkdev_add_pmu("pcie-msi", NULL, 1, PMU1_PCIE_MSI);
> + clkdev_add_pmu("pcie-pdi", NULL, 1, PMU1_PCIE_PDI);
> + clkdev_add_pmu("pcie-ctl", NULL, 1, PMU1_PCIE_CTL);
> + clkdev_add_pmu("ahb", NULL, 0, PMU_AHBM | PMU_AHBS);
> } else {
> clkdev_add_static("cpu", ltq_danube_cpu_hz());
> clkdev_add_static("fpi", ltq_danube_fpi_hz());
WBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] MIPS: lantiq: make use of module_platform_driver()
2012-02-17 10:33 ` [PATCH 3/3] MIPS: lantiq: make use of module_platform_driver() John Crispin
@ 2012-02-17 23:02 ` Daniel Schwierzeck
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Schwierzeck @ 2012-02-17 23:02 UTC (permalink / raw)
To: John Crispin; +Cc: Ralf Baechle, linux-mips
Am 17.02.2012 11:33, schrieb John Crispin:
> Reduce boilerplate code.
>
> Signed-off-by: John Crispin<blogic@openwrt.org>
> ---
> drivers/mtd/maps/lantiq-flash.c | 20 ++------------------
> drivers/net/ethernet/lantiq_etop.c | 20 ++------------------
> drivers/watchdog/lantiq_wdt.c | 17 ++---------------
> 3 files changed, 6 insertions(+), 51 deletions(-)
>
> diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c
> index 7b889de..e22436d 100644
> --- a/drivers/mtd/maps/lantiq-flash.c
> +++ b/drivers/mtd/maps/lantiq-flash.c
> @@ -203,6 +203,7 @@ ltq_mtd_remove(struct platform_device *pdev)
> }
>
> static struct platform_driver ltq_mtd_driver = {
> + .probe = ltq_mtd_probe,
you also need to change __init to __devinit at ltq_mtd_probe. Compiling
with CONFIG_DEBUG_SECTION_MISMATCH shows following warning:
WARNING: drivers/mtd/maps/built-in.o(.data+0x0): Section mismatch in
reference from the variable ltq_mtd_driver to the function
.init.text:ltq_mtd_probe()
The variable ltq_mtd_driver references
the function __init ltq_mtd_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the
variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
> .remove = __devexit_p(ltq_mtd_remove),
> .driver = {
> .name = "ltq_nor",
> @@ -210,24 +211,7 @@ static struct platform_driver ltq_mtd_driver = {
> },
> };
>
> -static int __init
> -init_ltq_mtd(void)
> -{
> - int ret = platform_driver_probe(<q_mtd_driver, ltq_mtd_probe);
> -
> - if (ret)
> - pr_err("ltq_nor: error registering platform driver");
> - return ret;
> -}
> -
> -static void __exit
> -exit_ltq_mtd(void)
> -{
> - platform_driver_unregister(<q_mtd_driver);
> -}
> -
> -module_init(init_ltq_mtd);
> -module_exit(exit_ltq_mtd);
> +module_platform_driver(ltq_mtd_driver);
>
> MODULE_LICENSE("GPL");
> MODULE_AUTHOR("John Crispin<blogic@openwrt.org>");
> diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
> index fa2580b..4cfc314 100644
> --- a/drivers/net/ethernet/lantiq_etop.c
> +++ b/drivers/net/ethernet/lantiq_etop.c
> @@ -943,6 +943,7 @@ ltq_etop_remove(struct platform_device *pdev)
> }
>
> static struct platform_driver ltq_mii_driver = {
> + .probe = ltq_etop_probe,
dito
> .remove = __devexit_p(ltq_etop_remove),
> .driver = {
> .name = "ltq_etop",
> @@ -950,24 +951,7 @@ static struct platform_driver ltq_mii_driver = {
> },
> };
>
> -int __init
> -init_ltq_etop(void)
> -{
> - int ret = platform_driver_probe(<q_mii_driver, ltq_etop_probe);
> -
> - if (ret)
> - pr_err("ltq_etop: Error registering platfom driver!");
> - return ret;
> -}
> -
> -static void __exit
> -exit_ltq_etop(void)
> -{
> - platform_driver_unregister(<q_mii_driver);
> -}
> -
> -module_init(init_ltq_etop);
> -module_exit(exit_ltq_etop);
> +module_platform_driver(ltq_mii_driver);
>
> MODULE_AUTHOR("John Crispin<blogic@openwrt.org>");
> MODULE_DESCRIPTION("Lantiq SoC ETOP");
> diff --git a/drivers/watchdog/lantiq_wdt.c b/drivers/watchdog/lantiq_wdt.c
> index 05646b8..572ac60 100644
> --- a/drivers/watchdog/lantiq_wdt.c
> +++ b/drivers/watchdog/lantiq_wdt.c
> @@ -227,6 +227,7 @@ ltq_wdt_remove(struct platform_device *pdev)
>
>
> static struct platform_driver ltq_wdt_driver = {
> + .probe = ltq_wdt_probe,
dito
> .remove = __devexit_p(ltq_wdt_remove),
> .driver = {
> .name = "ltq_wdt",
> @@ -234,21 +235,7 @@ static struct platform_driver ltq_wdt_driver = {
> },
> };
>
> -static int __init
> -init_ltq_wdt(void)
> -{
> - return platform_driver_probe(<q_wdt_driver, ltq_wdt_probe);
> -}
> -
> -static void __exit
> -exit_ltq_wdt(void)
> -{
> - return platform_driver_unregister(<q_wdt_driver);
> -}
> -
> -module_init(init_ltq_wdt);
> -module_exit(exit_ltq_wdt);
> -
> +module_platform_driver(ltq_wdt_driver);
> module_param(nowayout, int, 0);
> MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
>
--
Best regards,
Daniel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-02-17 23:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-17 10:33 [PATCH 1/3] MIPS: lantiq: unify xway prom code John Crispin
2012-02-17 10:33 ` [PATCH 2/3] MIPS: lantiq: add vr9 support John Crispin
2012-02-17 17:43 ` Sergei Shtylyov
2012-02-17 16:50 ` John Crispin
2012-02-17 10:33 ` [PATCH 3/3] MIPS: lantiq: make use of module_platform_driver() John Crispin
2012-02-17 23:02 ` Daniel Schwierzeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.