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/device.c | |
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/device.c')
-rw-r--r-- | drivers/of/device.c | 20 |
1 files changed, 10 insertions, 10 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 | ||