aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-07 15:18:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-07 15:18:52 -0500
commit02550d61f49266930e674286379d3601006b2893 (patch)
tree2d30df688b7f428908028dd20e83b22bc799dee7 /drivers
parent2d51daaa615e4724f24e43fa01e705c40551080a (diff)
parentc89810acbcf48c7004e912b2b4b862480b2d00e1 (diff)
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux-2.6
devicetree/next changes queued for v3.3 merge window * tag 'devicetree-for-linus-20120104' of git://git.secretlab.ca/git/linux-2.6: ARM: prom.h: Fix build error by removing unneeded header file irq: check domain hwirq range for DT translate dt: add empty of_get_node/of_put_node functions of/pdt: fix section mismatch warning i2c-designware: add OF binding support dt/i2c: Enumerate some of the known trivial i2c devices dt: reform for_each_property to for_each_property_of_node ARM/of: allow *machine_desc.dt_compat to be const of/base: Take NULL string into account for property with multiple strings OF/device-tree: Add some entries to vendor-prefixes.txt Fix up trivial add-add conflicts in include/linux/of.h
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c12
-rw-r--r--drivers/of/base.c10
-rw-r--r--drivers/of/fdt.c5
-rw-r--r--drivers/of/pdt.c2
4 files changed, 20 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 2d3657ab1258..5244c4724df7 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -34,6 +34,7 @@
34#include <linux/sched.h> 34#include <linux/sched.h>
35#include <linux/err.h> 35#include <linux/err.h>
36#include <linux/interrupt.h> 36#include <linux/interrupt.h>
37#include <linux/of_i2c.h>
37#include <linux/platform_device.h> 38#include <linux/platform_device.h>
38#include <linux/io.h> 39#include <linux/io.h>
39#include <linux/slab.h> 40#include <linux/slab.h>
@@ -137,6 +138,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
137 sizeof(adap->name)); 138 sizeof(adap->name));
138 adap->algo = &i2c_dw_algo; 139 adap->algo = &i2c_dw_algo;
139 adap->dev.parent = &pdev->dev; 140 adap->dev.parent = &pdev->dev;
141 adap->dev.of_node = pdev->dev.of_node;
140 142
141 adap->nr = pdev->id; 143 adap->nr = pdev->id;
142 r = i2c_add_numbered_adapter(adap); 144 r = i2c_add_numbered_adapter(adap);
@@ -144,6 +146,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
144 dev_err(&pdev->dev, "failure adding adapter\n"); 146 dev_err(&pdev->dev, "failure adding adapter\n");
145 goto err_free_irq; 147 goto err_free_irq;
146 } 148 }
149 of_i2c_register_devices(adap);
147 150
148 return 0; 151 return 0;
149 152
@@ -187,6 +190,14 @@ static int __devexit dw_i2c_remove(struct platform_device *pdev)
187 return 0; 190 return 0;
188} 191}
189 192
193#ifdef CONFIG_OF
194static const struct of_device_id dw_i2c_of_match[] = {
195 { .compatible = "snps,designware-i2c", },
196 {},
197};
198MODULE_DEVICE_TABLE(of, dw_i2c_of_match);
199#endif
200
190/* work with hotplug and coldplug */ 201/* work with hotplug and coldplug */
191MODULE_ALIAS("platform:i2c_designware"); 202MODULE_ALIAS("platform:i2c_designware");
192 203
@@ -195,6 +206,7 @@ static struct platform_driver dw_i2c_driver = {
195 .driver = { 206 .driver = {
196 .name = "i2c_designware", 207 .name = "i2c_designware",
197 .owner = THIS_MODULE, 208 .owner = THIS_MODULE,
209 .of_match_table = of_match_ptr(dw_i2c_of_match),
198 }, 210 },
199}; 211};
200 212
diff --git a/drivers/of/base.c b/drivers/of/base.c
index c6db9ab9046e..133908a6fd8d 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -752,7 +752,7 @@ int of_property_read_string_index(struct device_node *np, const char *propname,
752 752
753 for (i = 0; total < prop->length; total += l, p += l) { 753 for (i = 0; total < prop->length; total += l, p += l) {
754 l = strlen(p) + 1; 754 l = strlen(p) + 1;
755 if ((*p != 0) && (i++ == index)) { 755 if (i++ == index) {
756 *output = p; 756 *output = p;
757 return 0; 757 return 0;
758 } 758 }
@@ -790,11 +790,9 @@ int of_property_count_strings(struct device_node *np, const char *propname)
790 790
791 p = prop->value; 791 p = prop->value;
792 792
793 for (i = 0; total < prop->length; total += l, p += l) { 793 for (i = 0; total < prop->length; total += l, p += l, i++)
794 l = strlen(p) + 1; 794 l = strlen(p) + 1;
795 if (*p != 0) 795
796 i++;
797 }
798 return i; 796 return i;
799} 797}
800EXPORT_SYMBOL_GPL(of_property_count_strings); 798EXPORT_SYMBOL_GPL(of_property_count_strings);
@@ -1163,7 +1161,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
1163 if (!of_aliases) 1161 if (!of_aliases)
1164 return; 1162 return;
1165 1163
1166 for_each_property(pp, of_aliases->properties) { 1164 for_each_property_of_node(of_aliases, pp) {
1167 const char *start = pp->name; 1165 const char *start = pp->name;
1168 const char *end = start + strlen(start); 1166 const char *end = start + strlen(start);
1169 struct device_node *np; 1167 struct device_node *np;
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index fd85fa298e0f..91a375fb6ae6 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -18,6 +18,7 @@
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20 20
21#include <asm/setup.h> /* for COMMAND_LINE_SIZE */
21#ifdef CONFIG_PPC 22#ifdef CONFIG_PPC
22#include <asm/machdep.h> 23#include <asm/machdep.h>
23#endif /* CONFIG_PPC */ 24#endif /* CONFIG_PPC */
@@ -107,7 +108,7 @@ int of_fdt_is_compatible(struct boot_param_header *blob,
107 * of_fdt_match - Return true if node matches a list of compatible values 108 * of_fdt_match - Return true if node matches a list of compatible values
108 */ 109 */
109int of_fdt_match(struct boot_param_header *blob, unsigned long node, 110int of_fdt_match(struct boot_param_header *blob, unsigned long node,
110 const char **compat) 111 const char *const *compat)
111{ 112{
112 unsigned int tmp, score = 0; 113 unsigned int tmp, score = 0;
113 114
@@ -541,7 +542,7 @@ int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
541/** 542/**
542 * of_flat_dt_match - Return true if node matches a list of compatible values 543 * of_flat_dt_match - Return true if node matches a list of compatible values
543 */ 544 */
544int __init of_flat_dt_match(unsigned long node, const char **compat) 545int __init of_flat_dt_match(unsigned long node, const char *const *compat)
545{ 546{
546 return of_fdt_match(initial_boot_params, node, compat); 547 return of_fdt_match(initial_boot_params, node, compat);
547} 548}
diff --git a/drivers/of/pdt.c b/drivers/of/pdt.c
index bc5b3990f6ed..07cc1d678e4d 100644
--- a/drivers/of/pdt.c
+++ b/drivers/of/pdt.c
@@ -229,7 +229,7 @@ static struct device_node * __init of_pdt_build_tree(struct device_node *parent,
229 return ret; 229 return ret;
230} 230}
231 231
232static void *kernel_tree_alloc(u64 size, u64 align) 232static void * __init kernel_tree_alloc(u64 size, u64 align)
233{ 233{
234 return prom_early_alloc(size); 234 return prom_early_alloc(size);
235} 235}