diff options
author | Kjetil Oftedal <oftedal@gmail.com> | 2011-03-24 19:34:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-24 19:34:52 -0400 |
commit | 1c833bc3b60744a385ac66cc1bc72fbecd5670ab (patch) | |
tree | f8dc0c026de100c0a313cd05d59d901691e3f61d /arch/sparc/kernel | |
parent | b3f80f6d2b08772d7d00f34a062ff73c95f7c45c (diff) |
sparc32: Fix multiple RTC detections on SUN4D
During the preparation for testing the recent changes made to the SUN4D
specific code in the kernel by Sam Ravnborg the following was discovered:
Since the removal of of_platform_bus_type (commit: eca3930163ba8884060ce9d9ff5ef0d9b7c7b00f )
multiboard SUN4Ds have not been able to boot. The kernel crashes due to a
zero-pointer error encountered when registering multiple M48T59 RTCs
(There is one on each board).
A patch for the was previously submitted, but the problem was not a
serious at that time, as it would only generate warnings. Now the kernel
will crash and stop executing before the serial console has been started.
(Crash output can be viewed by using the -p boot flag)
Signed-off-by: Kjetil Oftedal <oftedal@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/time_32.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index 8237dd4dfeb4..4e236391b635 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c | |||
@@ -145,6 +145,10 @@ static int __devinit clock_probe(struct platform_device *op) | |||
145 | if (!model) | 145 | if (!model) |
146 | return -ENODEV; | 146 | return -ENODEV; |
147 | 147 | ||
148 | /* Only the primary RTC has an address property */ | ||
149 | if (!of_find_property(dp, "address", NULL)) | ||
150 | return -ENODEV; | ||
151 | |||
148 | m48t59_rtc.resource = &op->resource[0]; | 152 | m48t59_rtc.resource = &op->resource[0]; |
149 | if (!strcmp(model, "mk48t02")) { | 153 | if (!strcmp(model, "mk48t02")) { |
150 | /* Map the clock register io area read-only */ | 154 | /* Map the clock register io area read-only */ |