linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] rtc-s3c: Fix rtc-s3c driver initialization
@ 2010-05-27 15:57 Vasily Khoruzhick
  2010-06-14  6:04 ` Vasily Khoruzhick
  0 siblings, 1 reply; 5+ messages in thread
From: Vasily Khoruzhick @ 2010-05-27 15:57 UTC (permalink / raw)
  To: linux-arm-kernel

setfreq should be called only after rtc device registration,
as it uses rtc device; s3c_rtc_cpu_type should be checked
only once it was set.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 drivers/rtc/rtc-s3c.c |   29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index e5972b2..dc2081f 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -488,19 +488,7 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
 		goto err_nomap;
 	}
 
-	/* check to see if everything is setup correctly */
-
-	s3c_rtc_enable(pdev, 1);
-
- 	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 */
-
+	/* Register rtc and check to see if everything is setup correctly */
 	rtc = rtc_device_register("s3c", &pdev->dev, &s3c_rtcops,
 				  THIS_MODULE);
 
@@ -510,18 +498,27 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
 		goto err_nortc;
 	}
 
+	platform_set_drvdata(pdev, rtc);
+
+	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;
+	s3c_rtc_enable(pdev, 1);
+
+	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);
 
-	platform_set_drvdata(pdev, rtc);
 	return 0;
 
  err_nortc:
-	s3c_rtc_enable(pdev, 0);
 	iounmap(s3c_rtc_base);
 
  err_nomap:
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] rtc-s3c: Fix rtc-s3c driver initialization
  2010-05-27 15:57 [PATCH v2] rtc-s3c: Fix rtc-s3c driver initialization Vasily Khoruzhick
@ 2010-06-14  6:04 ` Vasily Khoruzhick
  2010-06-14 10:18   ` Maurus Cuelenaere
  0 siblings, 1 reply; 5+ messages in thread
From: Vasily Khoruzhick @ 2010-06-14  6:04 UTC (permalink / raw)
  To: linux-arm-kernel

? ????????? ?? 27 ??? 2010 18:57:26 ????? Vasily Khoruzhick ???????:
> setfreq should be called only after rtc device registration,
> as it uses rtc device; s3c_rtc_cpu_type should be checked
> only once it was set.
> 
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>

Hi, Ben.

What about this patch? I've seen similar series on linux-samsung-soc maillist, 
but neither their series nor my patch is applied to your tree. Why? :)

Regards
Vasily
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100614/3c8e6704/attachment.sig>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] rtc-s3c: Fix rtc-s3c driver initialization
  2010-06-14  6:04 ` Vasily Khoruzhick
@ 2010-06-14 10:18   ` Maurus Cuelenaere
  2010-06-14 10:38     ` Vasily Khoruzhick
  0 siblings, 1 reply; 5+ messages in thread
From: Maurus Cuelenaere @ 2010-06-14 10:18 UTC (permalink / raw)
  To: linux-arm-kernel

Op 14-06-10 08:04, Vasily Khoruzhick schreef:
> ? ????????? ?? 27 ??? 2010 18:57:26 ????? Vasily Khoruzhick ???????:
>> setfreq should be called only after rtc device registration,
>> as it uses rtc device; s3c_rtc_cpu_type should be checked
>> only once it was set.
>>
>> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> 
> Hi, Ben.
> 
> What about this patch? I've seen similar series on linux-samsung-soc maillist, 
> but neither their series nor my patch is applied to your tree. Why? :)
> 
> Regards
> Vasily

A similar patch is already in Linus' tree, see e893de59a4982791368b3ce412bc67dd601a88a0.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] rtc-s3c: Fix rtc-s3c driver initialization
  2010-06-14 10:18   ` Maurus Cuelenaere
@ 2010-06-14 10:38     ` Vasily Khoruzhick
  2010-06-14 10:44       ` Maurus Cuelenaere
  0 siblings, 1 reply; 5+ messages in thread
From: Vasily Khoruzhick @ 2010-06-14 10:38 UTC (permalink / raw)
  To: linux-arm-kernel

? ????????? ?? 14 ???? 2010 13:18:24 ????? Maurus Cuelenaere ???????:
> A similar patch is already in Linus' tree, see
> e893de59a4982791368b3ce412bc67dd601a88a0.

Thanks for pointing that.
Sad that this change is not in Ben's next-samsung yet :(

Regards
Vasily
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100614/899b7950/attachment.sig>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] rtc-s3c: Fix rtc-s3c driver initialization
  2010-06-14 10:38     ` Vasily Khoruzhick
@ 2010-06-14 10:44       ` Maurus Cuelenaere
  0 siblings, 0 replies; 5+ messages in thread
From: Maurus Cuelenaere @ 2010-06-14 10:44 UTC (permalink / raw)
  To: linux-arm-kernel

Op 14-06-10 12:38, Vasily Khoruzhick schreef:
> ? ????????? ?? 14 ???? 2010 13:18:24 ????? Maurus Cuelenaere ???????:
>   
>> A similar patch is already in Linus' tree, see
>> e893de59a4982791368b3ce412bc67dd601a88a0.
>>     
> Thanks for pointing that.
> Sad that this change is not in Ben's next-samsung yet :(
>   

It's just a matter of rebasing. And AFAICS current Ben's next-samsung ==
Linus' 2.6.35-rc1 tag.

-- 
Maurus Cuelenaere

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-14 10:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-27 15:57 [PATCH v2] rtc-s3c: Fix rtc-s3c driver initialization Vasily Khoruzhick
2010-06-14  6:04 ` Vasily Khoruzhick
2010-06-14 10:18   ` Maurus Cuelenaere
2010-06-14 10:38     ` Vasily Khoruzhick
2010-06-14 10:44       ` Maurus Cuelenaere

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).