* [PATCH 1/2] RTC: s3c: Initialize driver data before using it
[not found] <cover.1274994983.git.mcuelenaere@gmail.com>
@ 2010-05-27 21:28 ` Maurus Cuelenaere
2010-05-27 21:51 ` Andrew Morton
2010-05-27 21:28 ` [PATCH 2/2] RTC: s3c: Initialize s3c_rtc_cpu_type " Maurus Cuelenaere
1 sibling, 1 reply; 5+ messages in thread
From: Maurus Cuelenaere @ 2010-05-27 21:28 UTC (permalink / raw)
To: rtc-linux, linux-samsung-soc
Cc: ben-linux, a.zummo, p_gortmaker, Jiri.Pinkava, akpm
s3c_rtc_setfreq() uses the platform driver data to derive struct rtc_device,
so make sure drvdata is set _before_ s3c_rtc_setfreq() is called.
Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
---
drivers/rtc/rtc-s3c.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index e5972b2..6adebf3 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -495,8 +495,6 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
pr_debug("s3c2410_rtc: RTCCON=%02x\n",
readb(s3c_rtc_base + S3C2410_RTCCON));
- s3c_rtc_setfreq(&pdev->dev, 1);
-
device_init_wakeup(&pdev->dev, 1);
/* register RTC and exit */
@@ -518,6 +516,9 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
platform_set_drvdata(pdev, rtc);
+
+ s3c_rtc_setfreq(&pdev->dev, 1);
+
return 0;
err_nortc:
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] RTC: s3c: Initialize s3c_rtc_cpu_type before using it
[not found] <cover.1274994983.git.mcuelenaere@gmail.com>
2010-05-27 21:28 ` [PATCH 1/2] RTC: s3c: Initialize driver data before using it Maurus Cuelenaere
@ 2010-05-27 21:28 ` Maurus Cuelenaere
2010-05-27 21:52 ` Andrew Morton
1 sibling, 1 reply; 5+ messages in thread
From: Maurus Cuelenaere @ 2010-05-27 21:28 UTC (permalink / raw)
To: rtc-linux, linux-samsung-soc
Cc: ben-linux, a.zummo, p_gortmaker, Jiri.Pinkava, akpm
Make sure s3c_rtc_cpu_type is initialised _before_ it's used in an if() check.
This was probably caused due to a merge mistake.
Reported-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
---
drivers/rtc/rtc-s3c.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 6adebf3..70b68d3 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);
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] RTC: s3c: Initialize driver data before using it
2010-05-27 21:28 ` [PATCH 1/2] RTC: s3c: Initialize driver data before using it Maurus Cuelenaere
@ 2010-05-27 21:51 ` Andrew Morton
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2010-05-27 21:51 UTC (permalink / raw)
To: Maurus Cuelenaere
Cc: rtc-linux, linux-samsung-soc, ben-linux, a.zummo, p_gortmaker,
Jiri.Pinkava
On Thu, 27 May 2010 23:28:45 +0200
Maurus Cuelenaere <mcuelenaere@gmail.com> wrote:
> s3c_rtc_setfreq() uses the platform driver data to derive struct rtc_device,
> so make sure drvdata is set _before_ s3c_rtc_setfreq() is called.
>
> Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
> ---
> drivers/rtc/rtc-s3c.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> index e5972b2..6adebf3 100644
> --- a/drivers/rtc/rtc-s3c.c
> +++ b/drivers/rtc/rtc-s3c.c
> @@ -495,8 +495,6 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
> pr_debug("s3c2410_rtc: RTCCON=%02x\n",
> readb(s3c_rtc_base + S3C2410_RTCCON));
>
> - s3c_rtc_setfreq(&pdev->dev, 1);
> -
> device_init_wakeup(&pdev->dev, 1);
>
> /* register RTC and exit */
> @@ -518,6 +516,9 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
> s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
>
> platform_set_drvdata(pdev, rtc);
> +
> + s3c_rtc_setfreq(&pdev->dev, 1);
> +
> return 0;
>
> err_nortc:
This one I tagged for a -stable backport.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] RTC: s3c: Initialize s3c_rtc_cpu_type before using it
2010-05-27 21:28 ` [PATCH 2/2] RTC: s3c: Initialize s3c_rtc_cpu_type " Maurus Cuelenaere
@ 2010-05-27 21:52 ` Andrew Morton
2010-05-27 21:55 ` Maurus Cuelenaere
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2010-05-27 21:52 UTC (permalink / raw)
To: Maurus Cuelenaere
Cc: rtc-linux, linux-samsung-soc, ben-linux, a.zummo, p_gortmaker,
Jiri.Pinkava
On Thu, 27 May 2010 23:28:47 +0200
Maurus Cuelenaere <mcuelenaere@gmail.com> wrote:
> Make sure s3c_rtc_cpu_type is initialised _before_ it's used in an if() check.
>
> This was probably caused due to a merge mistake.
Nope, I went back to your original email:
@@ -471,7 +509,12 @@ static int __devinit s3c_rtc_probe(struct
platform_device *pdev)
goto err_nortc;
}
- rtc->max_user_freq = 128;
+ 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;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] RTC: s3c: Initialize s3c_rtc_cpu_type before using it
2010-05-27 21:52 ` Andrew Morton
@ 2010-05-27 21:55 ` Maurus Cuelenaere
0 siblings, 0 replies; 5+ messages in thread
From: Maurus Cuelenaere @ 2010-05-27 21:55 UTC (permalink / raw)
To: Andrew Morton
Cc: rtc-linux, linux-samsung-soc, ben-linux, a.zummo, p_gortmaker,
Jiri.Pinkava
Op 27-05-10 23:52, Andrew Morton schreef:
> On Thu, 27 May 2010 23:28:47 +0200
> Maurus Cuelenaere <mcuelenaere@gmail.com> wrote:
>
>
>> Make sure s3c_rtc_cpu_type is initialised _before_ it's used in an if() check.
>>
>> This was probably caused due to a merge mistake.
>>
> Nope, I went back to your original email:
>
> @@ -471,7 +509,12 @@ static int __devinit s3c_rtc_probe(struct
> platform_device *pdev)
> goto err_nortc;
> }
>
> - rtc->max_user_freq = 128;
> + 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;
>
Hmm, odd. Ok, I apologize for this (obvious) mistake then.
--
Maurus Cuelenaere
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-27 21:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1274994983.git.mcuelenaere@gmail.com>
2010-05-27 21:28 ` [PATCH 1/2] RTC: s3c: Initialize driver data before using it Maurus Cuelenaere
2010-05-27 21:51 ` Andrew Morton
2010-05-27 21:28 ` [PATCH 2/2] RTC: s3c: Initialize s3c_rtc_cpu_type " Maurus Cuelenaere
2010-05-27 21:52 ` Andrew Morton
2010-05-27 21:55 ` Maurus Cuelenaere
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.