Skip to content

Commit

Permalink
sparc32: Fix multiple RTC detections on SUN4D
Browse files Browse the repository at this point in the history
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: eca3930 )
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>
  • Loading branch information
Kjetil Oftedal authored and David S. Miller committed Mar 24, 2011
1 parent b3f80f6 commit 1c833bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/sparc/kernel/time_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ static int __devinit clock_probe(struct platform_device *op)
if (!model)
return -ENODEV;

/* Only the primary RTC has an address property */
if (!of_find_property(dp, "address", NULL))
return -ENODEV;

m48t59_rtc.resource = &op->resource[0];
if (!strcmp(model, "mk48t02")) {
/* Map the clock register io area read-only */
Expand Down

0 comments on commit 1c833bc

Please sign in to comment.