• Axel Lin's avatar
    rtc: ep93xx: Fix 'rtc' may be used uninitialized warning · bf6ed027
    Axel Lin authored
    commit 92d921c5 "rtc: ep93xx: Initialize drvdata before registering device"
    ensures the drvdata is initialized prior to registering the rtc device.
    But it set the drvdata to an uninitialized pointer.
    Thus calling platform_get_drvdata in ep93xx_rtc_remove does not get correct address.
    
    This patch fixes below warning by adding struct rtc_device *rtc to struct ep93xx_rtc.
    Then set platform drvdata to ep93xx_rtc instead of rtc.
    
      CC      drivers/rtc/rtc-ep93xx.o
    drivers/rtc/rtc-ep93xx.c: In function 'ep93xx_rtc_probe':
    drivers/rtc/rtc-ep93xx.c:154: warning: 'rtc' may be used uninitialized in this function
    Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
    Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
    bf6ed027
rtc-ep93xx.c 5.29 KB