• G
    stmmac: verify the dma_cfg platform fields · 0f1f88a8
    Giuseppe CAVALLARO 提交于
    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: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
    cc: Viresh Kumar <viresh.kumar@st.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    0f1f88a8
stmmac_platform.c 7.1 KB