From 938dfdaa3c0f92e9a490d324f3bce43bbaef7632 Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Fri, 17 Jan 2014 21:24:42 +0800 Subject: 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 Signed-off-by: David S. Miller --- include/linux/stmmac.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/linux/stmmac.h') diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 33ace712e7e8..0a5a7aca562e 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; -- cgit v1.2.3