diff for duplicates of <4E171E93.8020608@arm.com> diff --git a/a/1.txt b/N1/1.txt index 72921c2..cc1d3e7 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -20,7 +20,3 @@ What do you think? M. -- Jazz is not dead. It just smells funny... --------------- next part -------------- -An embedded and charset-unspecified text was scrubbed... -Name: code_dev.patch.txt -URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110708/ff104de1/attachment.txt> diff --git a/N1/2.hdr b/N1/2.hdr new file mode 100644 index 0000000..51a1c6e --- /dev/null +++ b/N1/2.hdr @@ -0,0 +1,4 @@ +Content-Type: text/plain; name=code_dev.patch.txt +Content-Transfer-Encoding: quoted-printable +Content-Disposition: inline; + filename="code_dev.patch.txt" diff --git a/N1/2.txt b/N1/2.txt new file mode 100644 index 0000000..8bdd66a --- /dev/null +++ b/N1/2.txt @@ -0,0 +1,207 @@ +diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c +index 74825c2..e7d9922 100644 +--- a/arch/arm/common/gic.c ++++ b/arch/arm/common/gic.c +@@ -712,9 +712,9 @@ static int __init gic_core_init(struct core_device *dev) + return 0; + } + +-static struct core_device_id gic_ids[] __initdata = { +- { .name = "arm,gic-spi" }, /* DT */ +- { .name = "arm_gic" }, /* Static device */ ++static struct of_device_id gic_ids[] __initdata = { ++ { .compatible = "arm,gic-spi" }, /* DT */ ++ { .name = "arm_gic" }, /* Static device */ + { }, + }; + +diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c +index 0b0681c..1cb4bd7 100644 +--- a/arch/arm/kernel/irq.c ++++ b/arch/arm/kernel/irq.c +@@ -114,15 +114,10 @@ void set_irq_flags(unsigned int irq, unsigned int iflags) + irq_modify_status(irq, clr, set & ~clr); + } + +-static struct of_device_id of_irq_controller_ids[] __initdata = { +- { .compatible = "arm,gic-spi", }, +- {}, +-}; +- + void __init init_IRQ(void) + { + machine_desc->init_irq(); +- of_core_device_populate(CORE_DEV_CLASS_IRQ, of_irq_controller_ids); ++ of_core_device_populate(CORE_DEV_CLASS_IRQ); + core_driver_init_class(CORE_DEV_CLASS_IRQ, core_device_irq_sort); + } + +diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c +index b879698..80f7ad2 100644 +--- a/arch/arm/kernel/time.c ++++ b/arch/arm/kernel/time.c +@@ -150,18 +150,13 @@ device_initcall(timer_init_syscore_ops); + + void (* __initdata arm_late_time_init)(void); + +-static struct of_device_id of_timer_ids[] __initdata = { +- { .compatible = "arm,smp-twd", }, +- {}, +-}; +- + static void __init __arm_late_time_init(void) + { + if (arm_late_time_init) + arm_late_time_init(); + + #ifdef CONFIG_LOCAL_TIMER_DEVICES +- of_core_device_populate(CORE_DEV_CLASS_TIMER, of_timer_ids); ++ of_core_device_populate(CORE_DEV_CLASS_TIMER); + core_driver_init_class(CORE_DEV_CLASS_TIMER, NULL); + #endif + } +diff --git a/drivers/base/core_device.c b/drivers/base/core_device.c +index a8df59d..0f1c585 100644 +--- a/drivers/base/core_device.c ++++ b/drivers/base/core_device.c +@@ -20,20 +20,22 @@ static struct list_head anchors[CORE_DEV_CLASS_MAX] __initdata = { + }; + + static int __init core_device_match(struct core_device *dev, +- struct core_device_id *ids) ++ struct of_device_id *ids) + { +- int i; + #ifdef CONFIG_OF +- if (dev->of_node) +- for (i = 0; ids[i].name != NULL; i++) +- if (of_device_is_compatible(dev->of_node, +- ids[i].name)) +- return 1; ++ if (dev->of_node) { ++ if (of_match_node(ids, dev->of_node)) ++ return 1; ++ ++ return 0; ++ } + #endif +- for (i = 0; ids[i].name != NULL; i++) +- if (!strcmp(dev->name, ids[i].name)) ++ while (ids->name[0] || ids->type[0] || ids->compatible[0]) { ++ if (ids->name[0] && !strcmp(dev->name, ids->name)) + return 1; + ++ ids++; ++ } + return 0; + } + +@@ -82,29 +84,37 @@ void __init core_driver_init_class(enum core_device_class class, + } + + #ifdef CONFIG_OF +-void __init of_core_device_populate(enum core_device_class class, +- struct of_device_id *matches) ++void __init of_core_device_populate(enum core_device_class class) + { ++ const struct core_driver_setup_block *b; + struct device_node *np; + struct core_device *dev; + int num_res; + +- for_each_matching_node(np, matches) { +- pr_debug("core: registering OF device %s\n", np->full_name); +- dev = kzalloc(sizeof(*dev), GFP_KERNEL); +- if (!dev) +- return; +- dev->name = np->name; +- dev->of_node = np; ++ for (b = __core_driver_block_start; b < __core_driver_block_end; b++) { ++ if (b->class != class) ++ continue; ++ ++ for_each_matching_node(np, b->drv->ids) { ++ pr_debug("core: registering OF device %s\n", ++ np->full_name); ++ dev = kzalloc(sizeof(*dev), GFP_KERNEL); ++ if (!dev) { ++ of_node_put(np); ++ return; ++ } ++ dev->resource = of_device_alloc_resources(np, &num_res); ++ if (num_res < 0) { ++ of_node_put(np); ++ kfree(dev); ++ return; ++ } + +- dev->resource = of_device_alloc_resources(np, &num_res); +- if (num_res < 0) { +- kfree(dev); +- return; ++ dev->num_resources = num_res; ++ dev->of_node = of_node_get(np); ++ dev->name = np->name; ++ core_device_register(class, dev); + } +- dev->num_resources = num_res; +- +- core_device_register(class, dev); + } + } + +diff --git a/drivers/clocksource/arm_smp_twd.c b/drivers/clocksource/arm_smp_twd.c +index 8d45000..717b4da 100644 +--- a/drivers/clocksource/arm_smp_twd.c ++++ b/drivers/clocksource/arm_smp_twd.c +@@ -389,9 +389,9 @@ static int __init twd_core_init(struct core_device *dev) + return 0; + } + +-static struct core_device_id twd_core_ids[] __initdata = { ++static struct of_device_id twd_core_ids[] __initdata = { + { .name = "arm_smp_twd", }, +- { .name = "arm,smp-twd", }, ++ { .compatible = "arm,smp-twd", }, + {}, + }; + +diff --git a/include/linux/core_device.h b/include/linux/core_device.h +index e632868..f21caba 100644 +--- a/include/linux/core_device.h ++++ b/include/linux/core_device.h +@@ -16,10 +16,6 @@ + #include <linux/ioport.h> + #include <linux/of.h> + +-struct core_device_id { +- const char *name; +-}; +- + enum core_device_class { + CORE_DEV_CLASS_IRQ, + CORE_DEV_CLASS_TIMER, +@@ -38,7 +34,7 @@ struct core_device { + + struct core_driver { + int (*init)(struct core_device *); +- struct core_device_id *ids; ++ struct of_device_id *ids; + }; + + void core_device_register(enum core_device_class class, +@@ -46,12 +42,10 @@ void core_device_register(enum core_device_class class, + void core_driver_init_class(enum core_device_class class, + void (*sort)(struct list_head *)); + #ifdef CONFIG_OF +-void of_core_device_populate(enum core_device_class class, +- struct of_device_id *matches); ++void of_core_device_populate(enum core_device_class class); + void core_device_irq_sort(struct list_head *head); + #else +-static inline void of_core_device_populate(enum core_device_class class, +- struct of_device_id *matches) ++static inline void of_core_device_populate(enum core_device_class class) + { + } + #define core_device_irq_sort NULL diff --git a/a/content_digest b/N1/content_digest index 447b8de..df446d2 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,11 +1,14 @@ "ref\01310115250-3859-1-git-send-email-marc.zyngier@arm.com\0" "ref\0CAHXqBFJiovYq5x_JDAxikvFs-t1To6yC-1uajBJFRX_jwjvejA@mail.gmail.com\0" "ref\04E170134.1020306@arm.com\0" - "From\0marc.zyngier@arm.com (Marc Zyngier)\0" - "Subject\0[RFC PATCH v2 0/4] Core device subsystem\0" + "From\0Marc Zyngier <marc.zyngier@arm.com>\0" + "Subject\0Re: [RFC PATCH v2 0/4] Core device subsystem\0" "Date\0Fri, 08 Jul 2011 16:13:23 +0100\0" - "To\0linux-arm-kernel@lists.infradead.org\0" - "\00:1\0" + "To\0Micha\305\202 Miros\305\202aw <mirqus@gmail.com>\0" + "Cc\0Grant Likely <grant.likely@secretlab.ca>" + linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org> + " linux-arm-kernel@lists.infradead.org <linux-arm-kernel@lists.infradead.org>\0" + "\01:1\0" "b\0" "On 08/07/11 14:08, Marc Zyngier wrote:\n" "> So you're basically folding of_core_device_populate() and\n" @@ -28,10 +31,216 @@ "\n" "\tM.\n" "-- \n" - "Jazz is not dead. It just smells funny...\n" - "-------------- next part --------------\n" - "An embedded and charset-unspecified text was scrubbed...\n" - "Name: code_dev.patch.txt\n" - URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110708/ff104de1/attachment.txt> + Jazz is not dead. It just smells funny... + "\01:2\0" + "fn\0code_dev.patch.txt\0" + "b\0" + "diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c\n" + "index 74825c2..e7d9922 100644\n" + "--- a/arch/arm/common/gic.c\n" + "+++ b/arch/arm/common/gic.c\n" + "@@ -712,9 +712,9 @@ static int __init gic_core_init(struct core_device *dev)\n" + " \treturn 0;\n" + " }\n" + " \n" + "-static struct core_device_id gic_ids[] __initdata = {\n" + "-\t{ .name = \"arm,gic-spi\" }, /* DT */\n" + "-\t{ .name = \"arm_gic\" }, /* Static device */\n" + "+static struct of_device_id gic_ids[] __initdata = {\n" + "+\t{ .compatible = \"arm,gic-spi\" }, /* DT */\n" + "+\t{ .name = \"arm_gic\" },\t\t /* Static device */\n" + " \t{ },\n" + " };\n" + " \n" + "diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c\n" + "index 0b0681c..1cb4bd7 100644\n" + "--- a/arch/arm/kernel/irq.c\n" + "+++ b/arch/arm/kernel/irq.c\n" + "@@ -114,15 +114,10 @@ void set_irq_flags(unsigned int irq, unsigned int iflags)\n" + " \tirq_modify_status(irq, clr, set & ~clr);\n" + " }\n" + " \n" + "-static struct of_device_id of_irq_controller_ids[] __initdata = {\n" + "-\t{ .compatible = \"arm,gic-spi\", },\n" + "-\t{},\n" + "-};\n" + "-\n" + " void __init init_IRQ(void)\n" + " {\n" + " \tmachine_desc->init_irq();\n" + "-\tof_core_device_populate(CORE_DEV_CLASS_IRQ, of_irq_controller_ids);\n" + "+\tof_core_device_populate(CORE_DEV_CLASS_IRQ);\n" + " \tcore_driver_init_class(CORE_DEV_CLASS_IRQ, core_device_irq_sort);\n" + " }\n" + " \n" + "diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c\n" + "index b879698..80f7ad2 100644\n" + "--- a/arch/arm/kernel/time.c\n" + "+++ b/arch/arm/kernel/time.c\n" + "@@ -150,18 +150,13 @@ device_initcall(timer_init_syscore_ops);\n" + " \n" + " void (* __initdata arm_late_time_init)(void);\n" + " \n" + "-static struct of_device_id of_timer_ids[] __initdata = {\n" + "-\t{ .compatible = \"arm,smp-twd\", },\n" + "-\t{},\n" + "-};\n" + "-\n" + " static void __init __arm_late_time_init(void)\n" + " {\n" + " \tif (arm_late_time_init)\n" + " \t\tarm_late_time_init();\n" + " \n" + " #ifdef CONFIG_LOCAL_TIMER_DEVICES\n" + "-\tof_core_device_populate(CORE_DEV_CLASS_TIMER, of_timer_ids);\n" + "+\tof_core_device_populate(CORE_DEV_CLASS_TIMER);\n" + " \tcore_driver_init_class(CORE_DEV_CLASS_TIMER, NULL);\n" + " #endif\n" + " }\n" + "diff --git a/drivers/base/core_device.c b/drivers/base/core_device.c\n" + "index a8df59d..0f1c585 100644\n" + "--- a/drivers/base/core_device.c\n" + "+++ b/drivers/base/core_device.c\n" + "@@ -20,20 +20,22 @@ static struct list_head anchors[CORE_DEV_CLASS_MAX] __initdata = {\n" + " };\n" + " \n" + " static int __init core_device_match(struct core_device *dev,\n" + "-\t\t\t\t struct core_device_id *ids)\n" + "+\t\t\t\t struct of_device_id *ids)\n" + " {\n" + "-\tint i;\n" + " #ifdef CONFIG_OF\n" + "-\tif (dev->of_node)\n" + "-\t\tfor (i = 0; ids[i].name != NULL; i++)\n" + "-\t\t\tif (of_device_is_compatible(dev->of_node,\n" + "-\t\t\t\t\t\t ids[i].name))\n" + "-\t\t\t\treturn 1;\n" + "+\tif (dev->of_node) {\n" + "+\t\tif (of_match_node(ids, dev->of_node))\n" + "+\t\t\treturn 1;\n" + "+\n" + "+\t\treturn 0;\n" + "+\t}\n" + " #endif\n" + "-\tfor (i = 0; ids[i].name != NULL; i++)\n" + "-\t\tif (!strcmp(dev->name, ids[i].name))\n" + "+\twhile (ids->name[0] || ids->type[0] || ids->compatible[0]) {\n" + "+\t\tif (ids->name[0] && !strcmp(dev->name, ids->name))\n" + " \t\t\treturn 1;\n" + " \n" + "+\t\tids++;\n" + "+\t}\n" + " \treturn 0;\n" + " }\n" + " \n" + "@@ -82,29 +84,37 @@ void __init core_driver_init_class(enum core_device_class class,\n" + " }\n" + " \n" + " #ifdef CONFIG_OF\n" + "-void __init of_core_device_populate(enum core_device_class class,\n" + "-\t\t\t struct of_device_id *matches)\n" + "+void __init of_core_device_populate(enum core_device_class class)\n" + " {\n" + "+\tconst struct core_driver_setup_block *b;\n" + " \tstruct device_node *np;\n" + " \tstruct core_device *dev;\n" + " \tint num_res;\n" + " \n" + "-\tfor_each_matching_node(np, matches) {\n" + "-\t\tpr_debug(\"core: registering OF device %s\\n\", np->full_name);\n" + "-\t\tdev = kzalloc(sizeof(*dev), GFP_KERNEL);\n" + "-\t\tif (!dev)\n" + "-\t\t\treturn;\n" + "-\t\tdev->name = np->name;\n" + "-\t\tdev->of_node = np;\n" + "+\tfor (b = __core_driver_block_start; b < __core_driver_block_end; b++) {\n" + "+\t\tif (b->class != class)\n" + "+\t\t\tcontinue;\n" + "+\n" + "+\t\tfor_each_matching_node(np, b->drv->ids) {\n" + "+\t\t\tpr_debug(\"core: registering OF device %s\\n\",\n" + "+\t\t\t\t np->full_name);\n" + "+\t\t\tdev = kzalloc(sizeof(*dev), GFP_KERNEL);\n" + "+\t\t\tif (!dev) {\n" + "+\t\t\t\tof_node_put(np);\n" + "+\t\t\t\treturn;\n" + "+\t\t\t}\n" + "+\t\t\tdev->resource = of_device_alloc_resources(np, &num_res);\n" + "+\t\t\tif (num_res < 0) {\n" + "+\t\t\t\tof_node_put(np);\n" + "+\t\t\t\tkfree(dev);\n" + "+\t\t\t\treturn;\n" + "+\t\t\t}\n" + " \n" + "-\t\tdev->resource = of_device_alloc_resources(np, &num_res);\n" + "-\t\tif (num_res < 0) {\n" + "-\t\t\tkfree(dev);\n" + "-\t\t\treturn;\n" + "+\t\t\tdev->num_resources = num_res;\n" + "+\t\t\tdev->of_node = of_node_get(np);\n" + "+\t\t\tdev->name = np->name;\n" + "+\t\t\tcore_device_register(class, dev);\n" + " \t\t}\n" + "-\t\tdev->num_resources = num_res;\n" + "-\n" + "-\t\tcore_device_register(class, dev);\n" + " \t}\n" + " }\n" + " \n" + "diff --git a/drivers/clocksource/arm_smp_twd.c b/drivers/clocksource/arm_smp_twd.c\n" + "index 8d45000..717b4da 100644\n" + "--- a/drivers/clocksource/arm_smp_twd.c\n" + "+++ b/drivers/clocksource/arm_smp_twd.c\n" + "@@ -389,9 +389,9 @@ static int __init twd_core_init(struct core_device *dev)\n" + " \treturn 0;\n" + " }\n" + " \n" + "-static struct core_device_id twd_core_ids[] __initdata = {\n" + "+static struct of_device_id twd_core_ids[] __initdata = {\n" + " \t{ .name\t= \"arm_smp_twd\", },\n" + "-\t{ .name = \"arm,smp-twd\", },\n" + "+\t{ .compatible = \"arm,smp-twd\", },\n" + " \t{},\n" + " };\n" + " \n" + "diff --git a/include/linux/core_device.h b/include/linux/core_device.h\n" + "index e632868..f21caba 100644\n" + "--- a/include/linux/core_device.h\n" + "+++ b/include/linux/core_device.h\n" + "@@ -16,10 +16,6 @@\n" + " #include <linux/ioport.h>\n" + " #include <linux/of.h>\n" + " \n" + "-struct core_device_id {\n" + "-\tconst char\t\t*name;\n" + "-};\n" + "-\n" + " enum core_device_class {\n" + " \tCORE_DEV_CLASS_IRQ,\n" + " \tCORE_DEV_CLASS_TIMER,\n" + "@@ -38,7 +34,7 @@ struct core_device {\n" + " \n" + " struct core_driver {\n" + " \tint\t\t\t(*init)(struct core_device *);\n" + "-\tstruct core_device_id\t*ids;\n" + "+\tstruct of_device_id\t*ids;\n" + " };\n" + " \n" + " void core_device_register(enum core_device_class class,\n" + "@@ -46,12 +42,10 @@ void core_device_register(enum core_device_class class,\n" + " void core_driver_init_class(enum core_device_class class,\n" + " \t\t\t void (*sort)(struct list_head *));\n" + " #ifdef CONFIG_OF\n" + "-void of_core_device_populate(enum core_device_class class,\n" + "-\t\t\t struct of_device_id *matches);\n" + "+void of_core_device_populate(enum core_device_class class);\n" + " void core_device_irq_sort(struct list_head *head);\n" + " #else\n" + "-static inline void of_core_device_populate(enum core_device_class class,\n" + "-\t\t\t\t\t struct of_device_id *matches)\n" + "+static inline void of_core_device_populate(enum core_device_class class)\n" + " {\n" + " }\n" + " #define core_device_irq_sort\tNULL" -921c8bbfab2f58ba5e34d9c135c81ac4ec3cb60f07cd7c8c08293475c48f7d9b +9cea80b7174409640ddc40882da4cf45f2487366cb08e05a042e122cf9bc41ac
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.