Problem with patch rtc: ep93xx: Initialize drvdata beforeregistering device

From: H Hartley Sweeten
Date: Thu May 26 2011 - 22:15:42 EST


Wolfram,

I think there is a problem with your patch:

commit 92d921c5def1a7b1411bc54859c0771b2cf2c08d
rtc: ep93xx: Initialize drvdata before registering device

You are calling platform_set_drvdata() with rtc == NULL at best, it
could possibly also be garbage. The rtc variable is allocated in
rtc_device_register().

A couple printk's prove this out:

ep93xx_rtc_probe: before platform_set_drvdata -> rtc: (null)
ep93xx-rtc ep93xx-rtc: rtc core: registered ep93xx-rtc as rtc0
ep93xx_rtc_probe: after rtc_device_register -> rtc: c4789c00

Regards,
Hartleyèº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—