summaryrefslogtreecommitdiffstats
path: root/include/linux/stmmac.h
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2014-01-17 21:24:42 +0800
committerDavid S. Miller <davem@davemloft.net>2014-01-19 20:02:02 -0800
commit938dfdaa3c0f92e9a490d324f3bce43bbaef7632 (patch)
treeda3396dd24faaa4898790d3e995bfb7ecb5ea0fb /include/linux/stmmac.h
parentc5e4ddbdfa1134a36589c1466ed4abb85fe6f976 (diff)
downloadop-kernel-dev-938dfdaa3c0f92e9a490d324f3bce43bbaef7632.zip
op-kernel-dev-938dfdaa3c0f92e9a490d324f3bce43bbaef7632.tar.gz
net: stmmac: Allocate and pass soc/board specific data to callbacks
The current .init and .exit callbacks requires access to driver private data structures. This is not a good seperation and abstraction. Instead, we add a new .setup callback for allocating private data, and pass the returned pointer to the other callbacks. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/stmmac.h')
-rw-r--r--include/linux/stmmac.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 33ace71..0a5a7ac 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -113,8 +113,10 @@ struct plat_stmmacenet_data {
int max_speed;
void (*fix_mac_speed)(void *priv, unsigned int speed);
void (*bus_setup)(void __iomem *ioaddr);
- int (*init)(struct platform_device *pdev);
- void (*exit)(struct platform_device *pdev);
+ void *(*setup)(struct platform_device *pdev);
+ void (*free)(struct platform_device *pdev, void *priv);
+ int (*init)(struct platform_device *pdev, void *priv);
+ void (*exit)(struct platform_device *pdev, void *priv);
void *custom_cfg;
void *custom_data;
void *bsp_priv;
OpenPOWER on IntegriCloud