powerpc: Fix Maple build
PATCH 1/1 powerpc: Fix Maple build
The changes to the device node structure broke Maple build. This fixes it. Unfortunately I coudn't test as my Maple board appears to be dead.
Signed-off-by Benjamin Herrenschmidt <[email protected]>
arch/powerpc/platforms/maple/pci.c +0 -1
@@ -316,7 +316,6 @@ static int __init add_bridge(struct devichar * disp_name;int *bus_range;int primary =1 ; -struct property *of_prop;DBG ("Adding PCI host bridge %s\n" , dev->full_name);
arch/powerpc/platforms/maple/setup.c +50 -35
130 lines not on this page · raw message
arch/powerpc/platforms/maple/time.c +18 -5
@@ -168,11 +168,24 @@ unsigned long __init maple_get_boot_timestruct rtc_time tm;struct device_node *rtcs; - rtcs =find_compatible_devices ("rtc" ,"pnpPNP,b00" ); -if (rtcs && rtcs->addrs) { - maple_rtc_addr = rtcs->addrs[0 ].address; -printk (KERN_INFO "Maple: Found RTC at 0x%x\n" , maple_rtc_addr); - }else { + rtcs =of_find_compatible_node (NULL ,"rtc" ,"pnpPNP,b00" ); +if (rtcs) { +struct resource r; +if (of_address_to_resource (rtcs,0 , &r)) { +printk (KERN_EMERG "Maple: Unable to translate RTC" +" address\n" ); + goto bail; + } +if (!(r.flags &IORESOURCE_IO )) { +printk (KERN_EMERG "Maple: RTC address isn't PIO!\n" ); + goto bail; + } + maple_rtc_addr = r.start; +printk (KERN_INFO "Maple: Found RTC at IO 0x%x\n" , + maple_rtc_addr); + } + bail: +if (maple_rtc_addr ==0 ) { maple_rtc_addr =RTC_PORT (0 );/* legacy address */ printk (KERN_INFO "Maple: No device node for RTC, assuming " "legacy address (0x%x)\n" , maple_rtc_addr);