dt:net:stmmac: Allocate platform data only if its NULL.
authorSrinivas Kandagatla <srinivas.kandagatla@st.com>
Thu, 4 Jul 2013 09:35:35 +0000 (10:35 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Jul 2013 21:34:17 +0000 (14:34 -0700)
commitd741434c3e0ae5592b72a0f4833a42b4be1b2fa1
tree10378f1e0e36060ba615ca2a4736e597c26176df
parentc9324d1870f3a7d13297ae6b787c567606ab3c89
dt:net:stmmac: Allocate platform data only if its NULL.

In some DT use-cases platform data might be already allocated and passed
via AUXDATA. These are the cases where machine level code populates few
callbacks in the platform data.

This patch adds check and reuses platform_data if its valid, before
allocating a new one.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c