diff options
Diffstat (limited to 'arch/powerpc/platforms/chrp/time.c')
-rw-r--r-- | arch/powerpc/platforms/chrp/time.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/chrp/time.c b/arch/powerpc/platforms/chrp/time.c index 737ee5d9f0aa..36a0f97bb7b1 100644 --- a/arch/powerpc/platforms/chrp/time.c +++ b/arch/powerpc/platforms/chrp/time.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/mc146818rtc.h> | 21 | #include <linux/mc146818rtc.h> |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/bcd.h> | 23 | #include <linux/bcd.h> |
24 | #include <linux/ioport.h> | ||
24 | 25 | ||
25 | #include <asm/io.h> | 26 | #include <asm/io.h> |
26 | #include <asm/nvram.h> | 27 | #include <asm/nvram.h> |
@@ -37,14 +38,16 @@ static int nvram_data = NVRAM_DATA; | |||
37 | long __init chrp_time_init(void) | 38 | long __init chrp_time_init(void) |
38 | { | 39 | { |
39 | struct device_node *rtcs; | 40 | struct device_node *rtcs; |
41 | struct resource r; | ||
40 | int base; | 42 | int base; |
41 | 43 | ||
42 | rtcs = find_compatible_devices("rtc", "pnpPNP,b00"); | 44 | rtcs = find_compatible_devices("rtc", "pnpPNP,b00"); |
43 | if (rtcs == NULL) | 45 | if (rtcs == NULL) |
44 | rtcs = find_compatible_devices("rtc", "ds1385-rtc"); | 46 | rtcs = find_compatible_devices("rtc", "ds1385-rtc"); |
45 | if (rtcs == NULL || rtcs->addrs == NULL) | 47 | if (rtcs == NULL || of_address_to_resource(rtcs, 0, &r)) |
46 | return 0; | 48 | return 0; |
47 | base = rtcs->addrs[0].address; | 49 | |
50 | base = r.start; | ||
48 | nvram_as1 = 0; | 51 | nvram_as1 = 0; |
49 | nvram_as0 = base; | 52 | nvram_as0 = base; |
50 | nvram_data = base + 1; | 53 | nvram_data = base + 1; |