summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-s3c.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2010-06-05 01:14:46 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-06-05 02:21:44 +0400
commiteaa6e4dd4bf243a357056448e54d7c673cd44acb (patch)
tree426fc027f4107ee520d2caabea2834587fa22a7d /drivers/rtc/rtc-s3c.c
parente893de59a4982791368b3ce412bc67dd601a88a0 (diff)
downloadlinux-eaa6e4dd4bf243a357056448e54d7c673cd44acb.tar.xz
rtc: s3c: initialize s3c_rtc_cpu_type before using it
Make sure s3c_rtc_cpu_type is initialised _before_ it's used in an if() check. Reported-by: Jiri Pinkava <jiri.pinkava@vscht.cz> Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com> Cc: Paul Gortmaker <p_gortmaker@yahoo.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Maurus Cuelenaere <mcuelenaere@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-s3c.c')
-rw-r--r--drivers/rtc/rtc-s3c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 6adebf31ea69..70b68d35f969 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -508,13 +508,13 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
goto err_nortc;
}
+ s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
+
if (s3c_rtc_cpu_type == TYPE_S3C64XX)
rtc->max_user_freq = 32768;
else
rtc->max_user_freq = 128;
- s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
-
platform_set_drvdata(pdev, rtc);
s3c_rtc_setfreq(&pdev->dev, 1);