diff --git a/arch/arm/boards/at91sam9x5ek/hw_version.c b/arch/arm/boards/at91sam9x5ek/hw_version.c index 1207a3e..2da4e5e 100644 --- a/arch/arm/boards/at91sam9x5ek/hw_version.c +++ b/arch/arm/boards/at91sam9x5ek/hw_version.c @@ -229,7 +229,7 @@ #define NODE_NAME_LEN 128 -static int cm_cogent_fixup(struct device_node *root) +static int cm_cogent_fixup(struct device_node *root, void *unused) { int ret; struct device_node *node; @@ -260,5 +260,5 @@ armlinux_set_serial(sn); if (at91sam9x5ek_cm_is_vendor(VENDOR_COGENT)) - of_register_fixup(cm_cogent_fixup); + of_register_fixup(cm_cogent_fixup, NULL); } diff --git a/arch/arm/boards/highbank/init.c b/arch/arm/boards/highbank/init.c index 7b1be04..8a24b21 100644 --- a/arch/arm/boards/highbank/init.c +++ b/arch/arm/boards/highbank/init.c @@ -24,7 +24,7 @@ struct fdt_header *fdt = NULL; -static int hb_fixup(struct device_node *root) +static int hb_fixup(struct device_node *root, void *unused) { struct device_node *node; u32 reg = readl(sregs_base + HB_SREG_A9_PWRDOM_DATA); @@ -108,7 +108,7 @@ static int highbank_devices_init(void) { - of_register_fixup(hb_fixup); + of_register_fixup(hb_fixup, NULL); if (!fdt) { highbank_register_gpio(0); highbank_register_gpio(1); diff --git a/arch/ppc/mach-mpc5xxx/cpu.c b/arch/ppc/mach-mpc5xxx/cpu.c index 0ece4a9..c860e70 100644 --- a/arch/ppc/mach-mpc5xxx/cpu.c +++ b/arch/ppc/mach-mpc5xxx/cpu.c @@ -77,7 +77,7 @@ /* ------------------------------------------------------------------------- */ #ifdef CONFIG_OFTREE -static int of_mpc5200_fixup(struct device_node *root) +static int of_mpc5200_fixup(struct device_node *root, void *unused) { struct device_node *node; @@ -103,7 +103,7 @@ static int of_register_mpc5200_fixup(void) { - return of_register_fixup(of_mpc5200_fixup); + return of_register_fixup(of_mpc5200_fixup, NULL); } late_initcall(of_register_mpc5200_fixup); #endif diff --git a/arch/ppc/mach-mpc85xx/fdt.c b/arch/ppc/mach-mpc85xx/fdt.c index 65de6f1..fd919a5 100644 --- a/arch/ppc/mach-mpc85xx/fdt.c +++ b/arch/ppc/mach-mpc85xx/fdt.c @@ -89,7 +89,7 @@ return -ENODEV; } -static int fdt_cpu_setup(struct device_node *blob) +static int fdt_cpu_setup(struct device_node *blob, void *unused) { struct device_node *node; struct sys_info sysinfo; @@ -139,6 +139,6 @@ static int of_register_mpc85xx_fixup(void) { - return of_register_fixup(fdt_cpu_setup); + return of_register_fixup(fdt_cpu_setup, NULL); } late_initcall(of_register_mpc85xx_fixup); diff --git a/common/memory.c b/common/memory.c index 7ec211b..c82bbaa 100644 --- a/common/memory.c +++ b/common/memory.c @@ -163,7 +163,7 @@ #ifdef CONFIG_OFTREE -static int of_memory_fixup(struct device_node *node) +static int of_memory_fixup(struct device_node *node, void *unused) { struct memory_bank *bank; int err; @@ -200,7 +200,7 @@ static int of_register_memory_fixup(void) { - return of_register_fixup(of_memory_fixup); + return of_register_fixup(of_memory_fixup, NULL); } late_initcall(of_register_memory_fixup); #endif diff --git a/common/oftree.c b/common/oftree.c index f2a3169..50fc95b 100644 --- a/common/oftree.c +++ b/common/oftree.c @@ -113,7 +113,7 @@ printf("commandline: %s\n", cmdline); } -static int of_fixup_bootargs(struct device_node *root) +static int of_fixup_bootargs(struct device_node *root, void *unused) { struct device_node *node; const char *str; @@ -135,22 +135,24 @@ static int of_register_bootargs_fixup(void) { - return of_register_fixup(of_fixup_bootargs); + return of_register_fixup(of_fixup_bootargs, NULL); } late_initcall(of_register_bootargs_fixup); struct of_fixup { - int (*fixup)(struct device_node *); + int (*fixup)(struct device_node *, void *); + void *context; struct list_head list; }; static LIST_HEAD(of_fixup_list); -int of_register_fixup(int (*fixup)(struct device_node *)) +int of_register_fixup(int (*fixup)(struct device_node *, void *), void *context) { struct of_fixup *of_fixup = xzalloc(sizeof(*of_fixup)); of_fixup->fixup = fixup; + of_fixup->context = context; list_add_tail(&of_fixup->list, &of_fixup_list); @@ -167,7 +169,7 @@ int ret; list_for_each_entry(of_fixup, &of_fixup_list, list) { - ret = of_fixup->fixup(node); + ret = of_fixup->fixup(node, of_fixup->context); if (ret) return ret; } diff --git a/include/of.h b/include/of.h index e5cd750..cd4cff8 100644 --- a/include/of.h +++ b/include/of.h @@ -62,7 +62,7 @@ struct driver_d; int of_fix_tree(struct device_node *); -int of_register_fixup(int (*fixup)(struct device_node *)); +int of_register_fixup(int (*fixup)(struct device_node *, void *), void *context); int of_match(struct device_d *dev, struct driver_d *drv); diff --git a/net/eth.c b/net/eth.c index e5d6a35..3867453 100644 --- a/net/eth.c +++ b/net/eth.c @@ -274,7 +274,7 @@ } #ifdef CONFIG_OFTREE -static int eth_of_fixup(struct device_node *root) +static int eth_of_fixup(struct device_node *root, void *unused) { struct eth_device *edev; struct device_node *node; @@ -316,7 +316,7 @@ static int eth_register_of_fixup(void) { - return of_register_fixup(eth_of_fixup); + return of_register_fixup(eth_of_fixup, NULL); } late_initcall(eth_register_of_fixup); #endif