Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336579
b: refs/heads/master
c: f2dcd0f
h: refs/heads/master
i:
  336577: 3f04024
  336575: ad27bcb
v: v3
  • Loading branch information
Grant Likely committed Dec 4, 2012
1 parent cefb0db commit ad21c11
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 300db34a7256c94dbb7676f1e87101a3bb13cdd9
refs/heads/master: f2dcd0f8287967bb8b59f3feb775638f767f8e82
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-vexpress/v2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void __init v2m_dt_init_early(void)
return;

/* Confirm board type against DT property, if available */
if (of_property_read_u32(allnodes, "arm,hbi", &dt_hbi) == 0) {
if (of_property_read_u32(of_allnodes, "arm,hbi", &dt_hbi) == 0) {
int site = v2m_get_master_site();
u32 id = readl(v2m_sysreg_base + (site == SYS_CFG_SITE_DB2 ?
V2M_SYS_PROCID1 : V2M_SYS_PROCID0));
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/sysdev/scom.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn,
ent->map = SCOM_MAP_INVALID;
spin_lock_init(&ent->lock);
snprintf(ent->name, 8, "scom%d", i);
ent->blob.data = dn->full_name;
ent->blob.data = (void*) dn->full_name;
ent->blob.size = strlen(dn->full_name);

dir = debugfs_create_dir(ent->name, root);
Expand Down
33 changes: 17 additions & 16 deletions trunk/drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ struct alias_prop {

static LIST_HEAD(aliases_lookup);

struct device_node *allnodes;
struct device_node *of_allnodes;
EXPORT_SYMBOL(of_allnodes);
struct device_node *of_chosen;
struct device_node *of_aliases;

Expand Down Expand Up @@ -199,7 +200,7 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
struct device_node *np;

read_lock(&devtree_lock);
np = prev ? prev->allnext : allnodes;
np = prev ? prev->allnext : of_allnodes;
for (; np != NULL; np = np->allnext)
if (of_node_get(np))
break;
Expand Down Expand Up @@ -422,7 +423,7 @@ EXPORT_SYMBOL(of_get_child_by_name);
*/
struct device_node *of_find_node_by_path(const char *path)
{
struct device_node *np = allnodes;
struct device_node *np = of_allnodes;

read_lock(&devtree_lock);
for (; np; np = np->allnext) {
Expand Down Expand Up @@ -452,7 +453,7 @@ struct device_node *of_find_node_by_name(struct device_node *from,
struct device_node *np;

read_lock(&devtree_lock);
np = from ? from->allnext : allnodes;
np = from ? from->allnext : of_allnodes;
for (; np; np = np->allnext)
if (np->name && (of_node_cmp(np->name, name) == 0)
&& of_node_get(np))
Expand Down Expand Up @@ -481,7 +482,7 @@ struct device_node *of_find_node_by_type(struct device_node *from,
struct device_node *np;

read_lock(&devtree_lock);
np = from ? from->allnext : allnodes;
np = from ? from->allnext : of_allnodes;
for (; np; np = np->allnext)
if (np->type && (of_node_cmp(np->type, type) == 0)
&& of_node_get(np))
Expand Down Expand Up @@ -512,7 +513,7 @@ struct device_node *of_find_compatible_node(struct device_node *from,
struct device_node *np;

read_lock(&devtree_lock);
np = from ? from->allnext : allnodes;
np = from ? from->allnext : of_allnodes;
for (; np; np = np->allnext) {
if (type
&& !(np->type && (of_node_cmp(np->type, type) == 0)))
Expand Down Expand Up @@ -545,7 +546,7 @@ struct device_node *of_find_node_with_property(struct device_node *from,
struct property *pp;

read_lock(&devtree_lock);
np = from ? from->allnext : allnodes;
np = from ? from->allnext : of_allnodes;
for (; np; np = np->allnext) {
for (pp = np->properties; pp; pp = pp->next) {
if (of_prop_cmp(pp->name, prop_name) == 0) {
Expand Down Expand Up @@ -616,7 +617,7 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
*match = NULL;

read_lock(&devtree_lock);
np = from ? from->allnext : allnodes;
np = from ? from->allnext : of_allnodes;
for (; np; np = np->allnext) {
if (of_match_node(matches, np) && of_node_get(np)) {
if (match)
Expand Down Expand Up @@ -669,7 +670,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)
struct device_node *np;

read_lock(&devtree_lock);
for (np = allnodes; np; np = np->allnext)
for (np = of_allnodes; np; np = np->allnext)
if (np->phandle == handle)
break;
of_node_get(np);
Expand Down Expand Up @@ -978,8 +979,8 @@ EXPORT_SYMBOL_GPL(of_property_count_strings);
* Returns the device_node pointer with refcount incremented. Use
* of_node_put() on it when done.
*/
struct device_node *
of_parse_phandle(struct device_node *np, const char *phandle_name, int index)
struct device_node *of_parse_phandle(const struct device_node *np,
const char *phandle_name, int index)
{
const __be32 *phandle;
int size;
Expand Down Expand Up @@ -1254,9 +1255,9 @@ void of_attach_node(struct device_node *np)

write_lock_irqsave(&devtree_lock, flags);
np->sibling = np->parent->child;
np->allnext = allnodes;
np->allnext = of_allnodes;
np->parent->child = np;
allnodes = np;
of_allnodes = np;
write_unlock_irqrestore(&devtree_lock, flags);
}

Expand All @@ -1277,11 +1278,11 @@ void of_detach_node(struct device_node *np)
if (!parent)
goto out_unlock;

if (allnodes == np)
allnodes = np->allnext;
if (of_allnodes == np)
of_allnodes = np->allnext;
else {
struct device_node *prev;
for (prev = allnodes;
for (prev = of_allnodes;
prev->allnext != np;
prev = prev->allnext)
;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/of/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
*/
void __init unflatten_device_tree(void)
{
__unflatten_device_tree(initial_boot_params, &allnodes,
__unflatten_device_tree(initial_boot_params, &of_allnodes,
early_init_dt_alloc_memory_arch);

/* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/of/of_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void of_i2c_register_devices(struct i2c_adapter *adap)

dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");

for_each_child_of_node(adap->dev.of_node, node) {
for_each_available_child_of_node(adap->dev.of_node, node) {
struct i2c_board_info info = {};
struct dev_archdata dev_ad = {};
const __be32 *addr;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/of/of_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
return rc;

/* Loop over the child nodes and register a phy_device for each one */
for_each_child_of_node(np, child) {
for_each_available_child_of_node(np, child) {
const __be32 *paddr;
u32 addr;
int len;
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/of/pdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ void __init of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops)
BUG_ON(!ops);
of_pdt_prom_ops = ops;

allnodes = of_pdt_create_node(root_node, NULL);
of_allnodes = of_pdt_create_node(root_node, NULL);
#if defined(CONFIG_SPARC)
allnodes->path_component_name = "";
of_allnodes->path_component_name = "";
#endif
allnodes->full_name = "/";
of_allnodes->full_name = "/";

nextp = &allnodes->allnext;
allnodes->child = of_pdt_build_tree(allnodes,
of_pdt_prom_ops->getchild(allnodes->phandle), &nextp);
nextp = &of_allnodes->allnext;
of_allnodes->child = of_pdt_build_tree(of_allnodes,
of_pdt_prom_ops->getchild(of_allnodes->phandle), &nextp);

/* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */
of_alias_scan(kernel_tree_alloc);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ static void of_register_spi_devices(struct spi_master *master)
if (!master->dev.of_node)
return;

for_each_child_of_node(master->dev.of_node, nc) {
for_each_available_child_of_node(master->dev.of_node, nc) {
/* Alloc an spi_device */
spi = spi_alloc_device(master);
if (!spi) {
Expand Down
8 changes: 4 additions & 4 deletions trunk/include/linux/of.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ static inline void of_node_put(struct device_node *node) { }
#ifdef CONFIG_OF

/* Pointer for first entry in chain of all nodes. */
extern struct device_node *allnodes;
extern struct device_node *of_allnodes;
extern struct device_node *of_chosen;
extern struct device_node *of_aliases;
extern rwlock_t devtree_lock;

static inline bool of_have_populated_dt(void)
{
return allnodes != NULL;
return of_allnodes != NULL;
}

static inline bool of_node_is_root(const struct device_node *node)
Expand Down Expand Up @@ -270,7 +270,7 @@ extern int of_n_size_cells(struct device_node *np);
extern const struct of_device_id *of_match_node(
const struct of_device_id *matches, const struct device_node *node);
extern int of_modalias_node(struct device_node *node, char *modalias, int len);
extern struct device_node *of_parse_phandle(struct device_node *np,
extern struct device_node *of_parse_phandle(const struct device_node *np,
const char *phandle_name,
int index);
extern int of_parse_phandle_with_args(struct device_node *np,
Expand Down Expand Up @@ -438,7 +438,7 @@ static inline int of_property_match_string(struct device_node *np,
return -ENOSYS;
}

static inline struct device_node *of_parse_phandle(struct device_node *np,
static inline struct device_node *of_parse_phandle(const struct device_node *np,
const char *phandle_name,
int index)
{
Expand Down

0 comments on commit ad21c11

Please sign in to comment.