diff options
author | Chen-Yu Tsai <wens@csie.org> | 2014-01-17 21:24:42 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-19 20:02:02 -0800 |
commit | 938dfdaa3c0f92e9a490d324f3bce43bbaef7632 (patch) | |
tree | da3396dd24faaa4898790d3e995bfb7ecb5ea0fb /Documentation | |
parent | c5e4ddbdfa1134a36589c1466ed4abb85fe6f976 (diff) | |
download | linux-stable-938dfdaa3c0f92e9a490d324f3bce43bbaef7632.tar.gz linux-stable-938dfdaa3c0f92e9a490d324f3bce43bbaef7632.tar.bz2 linux-stable-938dfdaa3c0f92e9a490d324f3bce43bbaef7632.zip |
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 'Documentation')
-rw-r--r-- | Documentation/networking/stmmac.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt index cdd916da838d..2090895b08d4 100644 --- a/Documentation/networking/stmmac.txt +++ b/Documentation/networking/stmmac.txt @@ -127,8 +127,9 @@ struct plat_stmmacenet_data { int riwt_off; 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); + 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; @@ -169,10 +170,13 @@ Where: o bus_setup: perform HW setup of the bus. For example, on some ST platforms this field is used to configure the AMBA bridge to generate more efficient STBus traffic. - o init/exit: callbacks used for calling a custom initialization; + o setup/init/exit: callbacks used for calling a custom initialization; this is sometime necessary on some platforms (e.g. ST boxes) where the HW needs to have set some PIO lines or system cfg - registers. + registers. setup should return a pointer to private data, + which will be stored in bsp_priv, and then passed to init and + exit callbacks. init/exit callbacks should not use or modify + platform data. o custom_cfg/custom_data: this is a custom configuration that can be passed while initializing the resources. o bsp_priv: another private pointer. |