Skip to content

Commit

Permalink
rtc: s3c: initialize s3c_rtc_cpu_type before using it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Maurus Cuelenaere authored and Linus Torvalds committed Jun 4, 2010
1 parent e893de5 commit eaa6e4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit eaa6e4d

Please sign in to comment.