aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJamie Iles <jamie@jamieiles.com>2011-03-08 15:17:06 -0500
committerJamie Iles <jamie@jamieiles.com>2011-11-22 10:21:16 -0500
commit84e0cdb0a262483a3618091c43dae33d36226430 (patch)
tree63d3213354567d1e407db2a4adbc26842deadb68 /drivers
parent461845db2176d2e11b45f1f24cbd0ed8ddf26fcb (diff)
macb: unify at91 and avr32 platform data
Both at91 and avr32 defines its own platform data structure for the macb driver and both share common structures though at91 includes a currently unused phy_irq_pin. Create a common macb_platform_data for macb that both at91 and avr32 can use. In future we can use this to support other architectures that use the same IP block with the macb driver. v2: rename eth_platform_data to macb_platform_data and allow at91_ether to share the platform data with macb. Signed-off-by: Jamie Iles <jamie@jamieiles.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/cadence/at91_ether.c3
-rw-r--r--drivers/net/ethernet/cadence/at91_ether.h4
-rw-r--r--drivers/net/ethernet/cadence/macb.c10
3 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 56624d303487..dfeb46cb3f74 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -26,6 +26,7 @@
26#include <linux/skbuff.h> 26#include <linux/skbuff.h>
27#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
28#include <linux/ethtool.h> 28#include <linux/ethtool.h>
29#include <linux/platform_data/macb.h>
29#include <linux/platform_device.h> 30#include <linux/platform_device.h>
30#include <linux/clk.h> 31#include <linux/clk.h>
31#include <linux/gfp.h> 32#include <linux/gfp.h>
@@ -984,7 +985,7 @@ static const struct net_device_ops at91ether_netdev_ops = {
984static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_address, 985static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_address,
985 struct platform_device *pdev, struct clk *ether_clk) 986 struct platform_device *pdev, struct clk *ether_clk)
986{ 987{
987 struct at91_eth_data *board_data = pdev->dev.platform_data; 988 struct macb_platform_data *board_data = pdev->dev.platform_data;
988 struct net_device *dev; 989 struct net_device *dev;
989 struct at91_private *lp; 990 struct at91_private *lp;
990 unsigned int val; 991 unsigned int val;
diff --git a/drivers/net/ethernet/cadence/at91_ether.h b/drivers/net/ethernet/cadence/at91_ether.h
index 353f4dab62be..3725fbb0defe 100644
--- a/drivers/net/ethernet/cadence/at91_ether.h
+++ b/drivers/net/ethernet/cadence/at91_ether.h
@@ -85,7 +85,9 @@ struct recv_desc_bufs
85struct at91_private 85struct at91_private
86{ 86{
87 struct mii_if_info mii; /* ethtool support */ 87 struct mii_if_info mii; /* ethtool support */
88 struct at91_eth_data board_data; /* board-specific configuration */ 88 struct macb_platform_data board_data; /* board-specific
89 * configuration (shared with
90 * macb for common data */
89 struct clk *ether_clk; /* clock */ 91 struct clk *ether_clk; /* clock */
90 92
91 /* PHY */ 93 /* PHY */
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index b0fa47870add..d97d9ce986f8 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -19,12 +19,10 @@
19#include <linux/netdevice.h> 19#include <linux/netdevice.h>
20#include <linux/etherdevice.h> 20#include <linux/etherdevice.h>
21#include <linux/dma-mapping.h> 21#include <linux/dma-mapping.h>
22#include <linux/platform_data/macb.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
23#include <linux/phy.h> 24#include <linux/phy.h>
24 25
25#include <mach/board.h>
26#include <mach/cpu.h>
27
28#include "macb.h" 26#include "macb.h"
29 27
30#define RX_BUFFER_SIZE 128 28#define RX_BUFFER_SIZE 128
@@ -191,7 +189,7 @@ static int macb_mii_probe(struct net_device *dev)
191{ 189{
192 struct macb *bp = netdev_priv(dev); 190 struct macb *bp = netdev_priv(dev);
193 struct phy_device *phydev; 191 struct phy_device *phydev;
194 struct eth_platform_data *pdata; 192 struct macb_platform_data *pdata;
195 int ret; 193 int ret;
196 194
197 phydev = phy_find_first(bp->mii_bus); 195 phydev = phy_find_first(bp->mii_bus);
@@ -228,7 +226,7 @@ static int macb_mii_probe(struct net_device *dev)
228 226
229static int macb_mii_init(struct macb *bp) 227static int macb_mii_init(struct macb *bp)
230{ 228{
231 struct eth_platform_data *pdata; 229 struct macb_platform_data *pdata;
232 int err = -ENXIO, i; 230 int err = -ENXIO, i;
233 231
234 /* Enable management port */ 232 /* Enable management port */
@@ -1119,7 +1117,7 @@ static const struct net_device_ops macb_netdev_ops = {
1119 1117
1120static int __init macb_probe(struct platform_device *pdev) 1118static int __init macb_probe(struct platform_device *pdev)
1121{ 1119{
1122 struct eth_platform_data *pdata; 1120 struct macb_platform_data *pdata;
1123 struct resource *regs; 1121 struct resource *regs;
1124 struct net_device *dev; 1122 struct net_device *dev;
1125 struct macb *bp; 1123 struct macb *bp;