• S
    net: stmmac: use suspend functions for hibernation · 33a23e22
    Srinivas Kandagatla 提交于
    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: NSrinivas Kandagatla <srinivas.kandagatla@st.com>
    Acked-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    33a23e22
stmmac_main.c 82.6 KB