• Russell King's avatar
    rtc: armada38x: make struct rtc_class_ops const · d748c981
    Russell King authored
    Armada38x wants to modify its rtc_class_ops to remove the interrupt
    handling when there is no usable interrupt, but this means we leave
    function pointers in writable memory.
    
    Since rtc_class_ops is small, arrange to have two instances, one for
    when we have interrupts, and one for when we have none, both marked
    const.  This allows the compiler to place them in read-only memory,
    which is better than placing them in __ro_after_init.
    
    Thanks to Bhumika Goyal <bhumirks@gmail.com> for pointing out that
    the structure was writable and submitting a patch to add
    __ro_after_init.
    Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
    Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
    d748c981
rtc-armada38x.c 9.49 KB