• Giuseppe CAVALLARO's avatar
    stmmac: verify the dma_cfg platform fields · 0f1f88a8
    Giuseppe CAVALLARO authored
    Recently the dma parameters that can be passed from the platform
    have been moved from the plat_stmmacenet_data to the stmmac_dma_cfg.
    
    In case of this new structure is not well allocated the driver can
    fails. This is an example how this field is managed in ST platforms
    
    static struct stmmac_dma_cfg gmac_dma_setting = {
            .pbl = 32,
    };
    
    static struct plat_stmmacenet_data stih415_ethernet_platform_data[] = {
    	{
    		.dma_cfg = &gmac_dma_setting,
    		.has_gmac = 1,
    [snip]
    
    This patch so verifies that the dma_cfg passed from the platform.
    In case of it is NULL there is no reason that the driver has to fail
    and some default values can be passed. These are ok for all the
    Synopsys chips and could impact on performances, only.
    Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
    cc: Viresh Kumar <viresh.kumar@st.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0f1f88a8
stmmac_platform.c 7.14 KB