diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-04-13 19:12:29 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-05-18 18:10:44 -0400 |
commit | 61c7a080a5a061c976988fd4b844dfb468dda255 (patch) | |
tree | 8cb492b73f2755c38a6164d770da34d5af6486a0 /drivers/of | |
parent | d12d42f744f805a9ccc33cd76f04b237cd83ce56 (diff) |
of: Always use 'struct device.of_node' to get device node pointer.
The following structure elements duplicate the information in
'struct device.of_node' and so are being eliminated. This patch
makes all readers of these elements use device.of_node instead.
(struct of_device *)->node
(struct dev_archdata *)->prom_node (sparc)
(struct dev_archdata *)->of_node (powerpc & microblaze)
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/device.c | 20 | ||||
-rw-r--r-- | drivers/of/of_i2c.c | 2 | ||||
-rw-r--r-- | drivers/of/of_mdio.c | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c index 224ae6bc67b6..24068bbbce1a 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c | |||
@@ -21,9 +21,9 @@ | |||
21 | const struct of_device_id *of_match_device(const struct of_device_id *matches, | 21 | const struct of_device_id *of_match_device(const struct of_device_id *matches, |
22 | const struct of_device *dev) | 22 | const struct of_device *dev) |
23 | { | 23 | { |
24 | if (!dev->node) | 24 | if (!dev->dev.of_node) |
25 | return NULL; | 25 | return NULL; |
26 | return of_match_node(matches, dev->node); | 26 | return of_match_node(matches, dev->dev.of_node); |
27 | } | 27 | } |
28 | EXPORT_SYMBOL(of_match_device); | 28 | EXPORT_SYMBOL(of_match_device); |
29 | 29 | ||
@@ -54,7 +54,7 @@ static ssize_t devspec_show(struct device *dev, | |||
54 | struct of_device *ofdev; | 54 | struct of_device *ofdev; |
55 | 55 | ||
56 | ofdev = to_of_device(dev); | 56 | ofdev = to_of_device(dev); |
57 | return sprintf(buf, "%s\n", ofdev->node->full_name); | 57 | return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name); |
58 | } | 58 | } |
59 | 59 | ||
60 | static ssize_t name_show(struct device *dev, | 60 | static ssize_t name_show(struct device *dev, |
@@ -63,7 +63,7 @@ static ssize_t name_show(struct device *dev, | |||
63 | struct of_device *ofdev; | 63 | struct of_device *ofdev; |
64 | 64 | ||
65 | ofdev = to_of_device(dev); | 65 | ofdev = to_of_device(dev); |
66 | return sprintf(buf, "%s\n", ofdev->node->name); | 66 | return sprintf(buf, "%s\n", ofdev->dev.of_node->name); |
67 | } | 67 | } |
68 | 68 | ||
69 | static ssize_t modalias_show(struct device *dev, | 69 | static ssize_t modalias_show(struct device *dev, |
@@ -97,14 +97,14 @@ void of_release_dev(struct device *dev) | |||
97 | struct of_device *ofdev; | 97 | struct of_device *ofdev; |
98 | 98 | ||
99 | ofdev = to_of_device(dev); | 99 | ofdev = to_of_device(dev); |
100 | of_node_put(ofdev->node); | 100 | of_node_put(ofdev->dev.of_node); |
101 | kfree(ofdev); | 101 | kfree(ofdev); |
102 | } | 102 | } |
103 | EXPORT_SYMBOL(of_release_dev); | 103 | EXPORT_SYMBOL(of_release_dev); |
104 | 104 | ||
105 | int of_device_register(struct of_device *ofdev) | 105 | int of_device_register(struct of_device *ofdev) |
106 | { | 106 | { |
107 | BUG_ON(ofdev->node == NULL); | 107 | BUG_ON(ofdev->dev.of_node == NULL); |
108 | 108 | ||
109 | device_initialize(&ofdev->dev); | 109 | device_initialize(&ofdev->dev); |
110 | 110 | ||
@@ -112,7 +112,7 @@ int of_device_register(struct of_device *ofdev) | |||
112 | * the parent. If there is no parent defined, set the node | 112 | * the parent. If there is no parent defined, set the node |
113 | * explicitly */ | 113 | * explicitly */ |
114 | if (!ofdev->dev.parent) | 114 | if (!ofdev->dev.parent) |
115 | set_dev_node(&ofdev->dev, of_node_to_nid(ofdev->node)); | 115 | set_dev_node(&ofdev->dev, of_node_to_nid(ofdev->dev.of_node)); |
116 | 116 | ||
117 | return device_add(&ofdev->dev); | 117 | return device_add(&ofdev->dev); |
118 | } | 118 | } |
@@ -132,11 +132,11 @@ ssize_t of_device_get_modalias(struct of_device *ofdev, | |||
132 | ssize_t tsize, csize, repend; | 132 | ssize_t tsize, csize, repend; |
133 | 133 | ||
134 | /* Name & Type */ | 134 | /* Name & Type */ |
135 | csize = snprintf(str, len, "of:N%sT%s", | 135 | csize = snprintf(str, len, "of:N%sT%s", ofdev->dev.of_node->name, |
136 | ofdev->node->name, ofdev->node->type); | 136 | ofdev->dev.of_node->type); |
137 | 137 | ||
138 | /* Get compatible property if any */ | 138 | /* Get compatible property if any */ |
139 | compat = of_get_property(ofdev->node, "compatible", &cplen); | 139 | compat = of_get_property(ofdev->dev.of_node, "compatible", &cplen); |
140 | if (!compat) | 140 | if (!compat) |
141 | return csize; | 141 | return csize; |
142 | 142 | ||
diff --git a/drivers/of/of_i2c.c b/drivers/of/of_i2c.c index e690a2aa6fef..604ba966e1c9 100644 --- a/drivers/of/of_i2c.c +++ b/drivers/of/of_i2c.c | |||
@@ -69,7 +69,7 @@ EXPORT_SYMBOL(of_register_i2c_devices); | |||
69 | 69 | ||
70 | static int of_dev_node_match(struct device *dev, void *data) | 70 | static int of_dev_node_match(struct device *dev, void *data) |
71 | { | 71 | { |
72 | return dev_archdata_get_node(&dev->archdata) == data; | 72 | return dev->of_node == data; |
73 | } | 73 | } |
74 | 74 | ||
75 | /* must call put_device() when done with returned i2c_client device */ | 75 | /* must call put_device() when done with returned i2c_client device */ |
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index 12090f57dc87..01d794abe105 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c | |||
@@ -101,7 +101,7 @@ EXPORT_SYMBOL(of_mdiobus_register); | |||
101 | /* Helper function for of_phy_find_device */ | 101 | /* Helper function for of_phy_find_device */ |
102 | static int of_phy_match(struct device *dev, void *phy_np) | 102 | static int of_phy_match(struct device *dev, void *phy_np) |
103 | { | 103 | { |
104 | return dev_archdata_get_node(&dev->archdata) == phy_np; | 104 | return dev->of_node == phy_np; |
105 | } | 105 | } |
106 | 106 | ||
107 | /** | 107 | /** |
@@ -167,7 +167,7 @@ struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, | |||
167 | if (!dev->dev.parent) | 167 | if (!dev->dev.parent) |
168 | return NULL; | 168 | return NULL; |
169 | 169 | ||
170 | net_np = dev_archdata_get_node(&dev->dev.parent->archdata); | 170 | net_np = dev->dev.parent->of_node; |
171 | if (!net_np) | 171 | if (!net_np) |
172 | return NULL; | 172 | return NULL; |
173 | 173 | ||