Skip to content

Commit

Permalink
rtc: rtc-sh: Fix up oops in early periodic freq assignment.
Browse files Browse the repository at this point in the history
With the reordered init order, the rtc device is not registered until
later, while sh_rtc_irq_set_freq() was attempting to assign ->irq_freq
directly, resulting in an oops. This is handled by the upper layers for
us, so just kill off the problematic dereference completely.

Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Sep 9, 2009
1 parent e7a963e commit 1043bf5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/rtc/rtc-sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,8 @@ static int sh_rtc_irq_set_freq(struct device *dev, int freq)
ret = -ENOTSUPP;
}

if (ret == 0) {
if (ret == 0)
rtc->periodic_freq |= tmp;
rtc->rtc_dev->irq_freq = freq;
}

spin_unlock_irq(&rtc->lock);
return ret;
Expand Down

0 comments on commit 1043bf5

Please sign in to comment.