aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/of_device.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-09-22 15:48:03 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-22 15:48:03 -0400
commit14d1adfc59ba66932ef167fdff62983e7c2b0197 (patch)
tree34bad21bf4ec220be87fa5d79ff41dd98e7dad9f /arch/powerpc/kernel/of_device.c
parente478bec0ba0a83a48a0f6982934b6de079e7e6b3 (diff)
parent69917c26c840e7de94522bf90fb190de63bf92bd (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (114 commits) [POWERPC] Fix ohare IDE irq workaround on old powermacs [POWERPC] EEH: Power4 systems sometimes need multiple resets. [POWERPC] Include <asm/mmu.h> in arch/powerpc/sysdev/fsl_soc.h for phys_addr_t. [POWERPC] Demacrofy arch/powerpc/platforms/maple/pci.c [POWERPC] Maple U3 HT - reject inappropriate config space access [POWERPC] Fix IPIC pending register assignments [POWERPC] powerpc: fix building gdb against asm/ptrace.h [POWERPC] Remove DISCONTIGMEM cruft from page.h [POWERPC] Merge iSeries i/o operations with the rest [POWERPC] 40x: Fix debug status register defines [POWERPC] Fix compile error in sbc8560 [POWERPC] EEH: support MMIO enable recovery step [POWERPC] EEH: enable MMIO/DMA on frozen slot [POWERPC] EEH: code comment cleanup [POWERPC] EEH: balance pcidev_get/put calls [POWERPC] PPC: Fix xmon stack frame address in backtrace [POWERPC] Add AT_PLATFORM value for Xilinx Virtex-4 FX [POWERPC] Start arch/powerpc/boot code reorganization [POWERPC] Define of_read_ulong helper [POWERPC] iseries: eliminate a couple of warnings ...
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