aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/of_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/of_device.c')
-rw-r--r--arch/powerpc/kernel/of_device.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
index 3262b73a3a68..397c83eda20e 100644
--- a/arch/powerpc/kernel/of_device.c
+++ b/arch/powerpc/kernel/of_device.c
@@ -189,27 +189,9 @@ void of_release_dev(struct device *dev)
189int of_device_register(struct of_device *ofdev) 189int of_device_register(struct of_device *ofdev)
190{ 190{
191 int rc; 191 int rc;
192 struct of_device **odprop;
193 192
194 BUG_ON(ofdev->node == NULL); 193 BUG_ON(ofdev->node == NULL);
195 194
196 odprop = (struct of_device **)get_property(ofdev->node, "linux,device", NULL);
197 if (!odprop) {
198 struct property *new_prop;
199
200 new_prop = kmalloc(sizeof(struct property) + sizeof(struct of_device *),
201 GFP_KERNEL);
202 if (new_prop == NULL)
203 return -ENOMEM;
204 new_prop->name = "linux,device";
205 new_prop->length = sizeof(sizeof(struct of_device *));
206 new_prop->value = (unsigned char *)&new_prop[1];
207 odprop = (struct of_device **)new_prop->value;
208 *odprop = NULL;
209 prom_add_property(ofdev->node, new_prop);
210 }
211 *odprop = ofdev;
212
213 rc = device_register(&ofdev->dev); 195 rc = device_register(&ofdev->dev);
214 if (rc) 196 if (rc)
215 return rc; 197 return rc;
@@ -221,14 +203,8 @@ int of_device_register(struct of_device *ofdev)
221 203
222void of_device_unregister(struct of_device *ofdev) 204void of_device_unregister(struct of_device *ofdev)
223{ 205{
224 struct of_device **odprop;
225
226 device_remove_file(&ofdev->dev, &dev_attr_devspec); 206 device_remove_file(&ofdev->dev, &dev_attr_devspec);
227 207
228 odprop = (struct of_device **)get_property(ofdev->node, "linux,device", NULL);
229 if (odprop)
230 *odprop = NULL;
231
232 device_unregister(&ofdev->dev); 208 device_unregister(&ofdev->dev);
233} 209}
234 210