• Srinivas Kandagatla's avatar
    net: stmmac: use suspend functions for hibernation · 33a23e22
    Srinivas Kandagatla authored
    In hibernation freeze case the driver just releases the resources like
    dma buffers, irqs, unregisters the drivers and during restore it does
    register, request the resources. This is not really necessary, as part
    of power management all the data structures are intact, all the
    previously allocated resources can be used after coming out of low
    power.
    
    This patch uses the suspend and resume callbacks for freeze and
    restore which initializes the hardware correctly without unregistering
    or releasing the resources, this should also help in reducing the time
    to restore.
    
    Also this patch fixes a bug in stmmac_pltfr_restore and
    stmmac_pltfr_freeze where it tries to get hold of platform data via
    dev_get_platdata call, which would return NULL in device tree cases and
    the next if statement would crash as there is no NULL check.
    Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@st.com>
    Acked-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    33a23e22
stmmac_platform.c 7.36 KB