* [PATCH 01/14] net/fec: no need to cast arguments for memcpy
@ 2011-02-11 10:32 Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove Uwe Kleine-König
` (13 more replies)
0 siblings, 14 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
memcpy takes a const void * as 2nd argument. So the argument is
converted automatically to void * anyhow.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 2a71373..3e6e923 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -284,7 +284,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (((unsigned long) bufaddr) & FEC_ALIGNMENT) {
unsigned int index;
index = bdp - fep->tx_bd_base;
- memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len);
+ memcpy(fep->tx_bounce[index], skb->data, skb->len);
bufaddr = fep->tx_bounce[index];
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 11:03 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 03/14] net/fec: don't free an irq that failed to be requested Uwe Kleine-König
` (12 subsequent siblings)
13 siblings, 1 reply; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
Noticed-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 3e6e923..b079826 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1377,8 +1377,10 @@ fec_probe(struct platform_device *pdev)
/* Init network device */
ndev = alloc_etherdev(sizeof(struct fec_enet_private));
- if (!ndev)
- return -ENOMEM;
+ if (!ndev) {
+ ret = -ENOMEM;
+ goto failed_alloc_etherdev;
+ }
SET_NETDEV_DEV(ndev, &pdev->dev);
@@ -1456,6 +1458,8 @@ failed_irq:
iounmap((void __iomem *)ndev->base_addr);
failed_ioremap:
free_netdev(ndev);
+failed_alloc_etherdev:
+ release_mem_region(r->start, resource_size(r));
return ret;
}
@@ -1465,6 +1469,7 @@ fec_drv_remove(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct fec_enet_private *fep = netdev_priv(ndev);
+ struct resource *r;
platform_set_drvdata(pdev, NULL);
@@ -1475,6 +1480,11 @@ fec_drv_remove(struct platform_device *pdev)
iounmap((void __iomem *)ndev->base_addr);
unregister_netdev(ndev);
free_netdev(ndev);
+
+ r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ BUG_ON(!r);
+ release_mem_region(r->start, resource_size(r));
+
return 0;
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 03/14] net/fec: don't free an irq that failed to be requested
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 04/14] net/fec: no need to check for validity of ndev in suspend and resume Uwe Kleine-König
` (11 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
Noticed-by: Lothar Waßmann <LW@KARO-elektronics.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index b079826..aa1db8e 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1409,10 +1409,9 @@ fec_probe(struct platform_device *pdev)
break;
ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev);
if (ret) {
- while (i >= 0) {
+ while (--i >= 0) {
irq = platform_get_irq(pdev, i);
free_irq(irq, ndev);
- i--;
}
goto failed_irq;
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 04/14] net/fec: no need to check for validity of ndev in suspend and resume
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 03/14] net/fec: don't free an irq that failed to be requested Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 05/14] net/fec: no need to memzero private data Uwe Kleine-König
` (10 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
dev_set_drvdata is called unconditionally in the probe function and so
it cannot be NULL.
Noticed-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 28 ++++++++++++----------------
1 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index aa1db8e..8026a16 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1492,16 +1492,14 @@ static int
fec_suspend(struct device *dev)
{
struct net_device *ndev = dev_get_drvdata(dev);
- struct fec_enet_private *fep;
+ struct fec_enet_private *fep = netdev_priv(ndev);
- if (ndev) {
- fep = netdev_priv(ndev);
- if (netif_running(ndev)) {
- fec_stop(ndev);
- netif_device_detach(ndev);
- }
- clk_disable(fep->clk);
+ if (netif_running(ndev)) {
+ fec_stop(ndev);
+ netif_device_detach(ndev);
}
+ clk_disable(fep->clk);
+
return 0;
}
@@ -1509,16 +1507,14 @@ static int
fec_resume(struct device *dev)
{
struct net_device *ndev = dev_get_drvdata(dev);
- struct fec_enet_private *fep;
+ struct fec_enet_private *fep = netdev_priv(ndev);
- if (ndev) {
- fep = netdev_priv(ndev);
- clk_enable(fep->clk);
- if (netif_running(ndev)) {
- fec_restart(ndev, fep->full_duplex);
- netif_device_attach(ndev);
- }
+ clk_enable(fep->clk);
+ if (netif_running(ndev)) {
+ fec_restart(ndev, fep->full_duplex);
+ netif_device_attach(ndev);
}
+
return 0;
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 05/14] net/fec: no need to memzero private data
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
` (2 preceding siblings ...)
2011-02-11 10:32 ` [PATCH 04/14] net/fec: no need to check for validity of ndev in suspend and resume Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 06/14] net/fec: put the ioremap cookie immediately into a void __iomem pointer Uwe Kleine-König
` (9 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
alloc_etherdev internally uses kzalloc, so the private data is already
zerod out.
Noticed-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 8026a16..9a25e1e 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1386,7 +1386,6 @@ fec_probe(struct platform_device *pdev)
/* setup board info structure */
fep = netdev_priv(ndev);
- memset(fep, 0, sizeof(*fep));
ndev->base_addr = (unsigned long)ioremap(r->start, resource_size(r));
fep->pdev = pdev;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 06/14] net/fec: put the ioremap cookie immediately into a void __iomem pointer
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
` (3 preceding siblings ...)
2011-02-11 10:32 ` [PATCH 05/14] net/fec: no need to memzero private data Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 07/14] net/fec: consolidate all i.MX options to CONFIG_ARM Uwe Kleine-König
` (8 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
Saving it first into struct net_device->base_addr (which is an unsigned
long) is pointless and only needs to use more casts than necessary.
Noticed-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 9a25e1e..14eb660 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1170,7 +1170,6 @@ static int fec_enet_init(struct net_device *dev)
spin_lock_init(&fep->hw_lock);
- fep->hwp = (void __iomem *)dev->base_addr;
fep->netdev = dev;
/* Get the Ethernet address */
@@ -1387,10 +1386,10 @@ fec_probe(struct platform_device *pdev)
/* setup board info structure */
fep = netdev_priv(ndev);
- ndev->base_addr = (unsigned long)ioremap(r->start, resource_size(r));
+ fep->hwp = ioremap(r->start, resource_size(r));
fep->pdev = pdev;
- if (!ndev->base_addr) {
+ if (!fep->hwp) {
ret = -ENOMEM;
goto failed_ioremap;
}
@@ -1453,7 +1452,7 @@ failed_clk:
free_irq(irq, ndev);
}
failed_irq:
- iounmap((void __iomem *)ndev->base_addr);
+ iounmap(fep->hwp);
failed_ioremap:
free_netdev(ndev);
failed_alloc_etherdev:
@@ -1475,7 +1474,7 @@ fec_drv_remove(struct platform_device *pdev)
fec_enet_mii_remove(fep);
clk_disable(fep->clk);
clk_put(fep->clk);
- iounmap((void __iomem *)ndev->base_addr);
+ iounmap(fep->hwp);
unregister_netdev(ndev);
free_netdev(ndev);
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 07/14] net/fec: consolidate all i.MX options to CONFIG_ARM
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
` (4 preceding siblings ...)
2011-02-11 10:32 ` [PATCH 06/14] net/fec: put the ioremap cookie immediately into a void __iomem pointer Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 08/14] net/fec: add phy_stop to fec_enet_close Uwe Kleine-König
` (7 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
Moreover stop listing all i.MX platforms featuring a FEC, and use
the platform's config symbol that selects registration of a fec device
instead. This might make it easier to add new platforms.
Set default = y for ARMs having a fec to reduce defconfig sizes.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/Kconfig | 3 ++-
drivers/net/fec.c | 5 ++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 0382332..65027a7 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1944,7 +1944,8 @@ config 68360_ENET
config FEC
bool "FEC ethernet controller (of ColdFire and some i.MX CPUs)"
depends on M523x || M527x || M5272 || M528x || M520x || M532x || \
- MACH_MX27 || ARCH_MX35 || ARCH_MX25 || ARCH_MX5 || SOC_IMX28
+ IMX_HAVE_PLATFORM_FEC || MXS_HAVE_PLATFORM_FEC
+ default IMX_HAVE_PLATFORM_FEC || MXS_HAVE_PLATFORM_FEC if ARM
select PHYLIB
help
Say Y here if you want to use the built-in 10/100 Fast ethernet
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 14eb660..dd4e580 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -54,7 +54,7 @@
#include "fec.h"
-#if defined(CONFIG_ARCH_MXC) || defined(CONFIG_SOC_IMX28)
+#if defined(CONFIG_ARM)
#define FEC_ALIGNMENT 0xf
#else
#define FEC_ALIGNMENT 0x3
@@ -147,8 +147,7 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address");
* account when setting it.
*/
#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
- defined(CONFIG_M520x) || defined(CONFIG_M532x) || \
- defined(CONFIG_ARCH_MXC) || defined(CONFIG_SOC_IMX28)
+ defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM)
#define OPT_FRAME_SIZE (PKT_MAXBUF_SIZE << 16)
#else
#define OPT_FRAME_SIZE 0
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 08/14] net/fec: add phy_stop to fec_enet_close
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
` (5 preceding siblings ...)
2011-02-11 10:32 ` [PATCH 07/14] net/fec: consolidate all i.MX options to CONFIG_ARM Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 09/14] net/fec: consistenly name struct net_device pointers "ndev" Uwe Kleine-König
` (6 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
This undoes the effects of phy_start in fec_enet_open.
Noticed-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index dd4e580..d3dbff5 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1029,8 +1029,10 @@ fec_enet_close(struct net_device *dev)
netif_stop_queue(dev);
fec_stop(dev);
- if (fep->phy_dev)
+ if (fep->phy_dev) {
+ phy_stop(fep->phy_dev);
phy_disconnect(fep->phy_dev);
+ }
fec_enet_free_buffers(dev);
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 09/14] net/fec: consistenly name struct net_device pointers "ndev"
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
` (6 preceding siblings ...)
2011-02-11 10:32 ` [PATCH 08/14] net/fec: add phy_stop to fec_enet_close Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 10/14] net/fec: some whitespace cleanup Uwe Kleine-König
` (5 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
A variable named "dev" usually (usually subjective) points to a struct
device.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 242 ++++++++++++++++++++++++++--------------------------
1 files changed, 121 insertions(+), 121 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index d3dbff5..c70503a 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -206,11 +206,11 @@ struct fec_enet_private {
};
static irqreturn_t fec_enet_interrupt(int irq, void * dev_id);
-static void fec_enet_tx(struct net_device *dev);
-static void fec_enet_rx(struct net_device *dev);
-static int fec_enet_close(struct net_device *dev);
-static void fec_restart(struct net_device *dev, int duplex);
-static void fec_stop(struct net_device *dev);
+static void fec_enet_tx(struct net_device *ndev);
+static void fec_enet_rx(struct net_device *ndev);
+static int fec_enet_close(struct net_device *ndev);
+static void fec_restart(struct net_device *ndev, int duplex);
+static void fec_stop(struct net_device *ndev);
/* FEC MII MMFR bits definition */
#define FEC_MMFR_ST (1 << 30)
@@ -238,9 +238,9 @@ static void *swap_buffer(void *bufaddr, int len)
}
static netdev_tx_t
-fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
+fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
const struct platform_device_id *id_entry =
platform_get_device_id(fep->pdev);
struct bufdesc *bdp;
@@ -261,9 +261,9 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (status & BD_ENET_TX_READY) {
/* Ooops. All transmit buffers are full. Bail out.
- * This should not happen, since dev->tbusy should be set.
+ * This should not happen, since ndev->tbusy should be set.
*/
- printk("%s: tx queue full!.\n", dev->name);
+ printk("%s: tx queue full!.\n", ndev->name);
spin_unlock_irqrestore(&fep->hw_lock, flags);
return NETDEV_TX_BUSY;
}
@@ -298,13 +298,13 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Save skb pointer */
fep->tx_skbuff[fep->skb_cur] = skb;
- dev->stats.tx_bytes += skb->len;
+ ndev->stats.tx_bytes += skb->len;
fep->skb_cur = (fep->skb_cur+1) & TX_RING_MOD_MASK;
/* Push the data cache so the CPM does not get stale memory
* data.
*/
- bdp->cbd_bufaddr = dma_map_single(&dev->dev, bufaddr,
+ bdp->cbd_bufaddr = dma_map_single(&ndev->dev, bufaddr,
FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE);
/* Send it on its way. Tell FEC it's ready, interrupt when done,
@@ -325,7 +325,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (bdp == fep->dirty_tx) {
fep->tx_full = 1;
- netif_stop_queue(dev);
+ netif_stop_queue(ndev);
}
fep->cur_tx = bdp;
@@ -336,22 +336,22 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
static void
-fec_timeout(struct net_device *dev)
+fec_timeout(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
- dev->stats.tx_errors++;
+ ndev->stats.tx_errors++;
- fec_restart(dev, fep->full_duplex);
- netif_wake_queue(dev);
+ fec_restart(ndev, fep->full_duplex);
+ netif_wake_queue(ndev);
}
static irqreturn_t
-fec_enet_interrupt(int irq, void * dev_id)
+fec_enet_interrupt(int irq, void *dev_id)
{
- struct net_device *dev = dev_id;
- struct fec_enet_private *fep = netdev_priv(dev);
- uint int_events;
+ struct net_device *ndev = dev_id;
+ struct fec_enet_private *fep = netdev_priv(ndev);
+ uint int_events;
irqreturn_t ret = IRQ_NONE;
do {
@@ -360,7 +360,7 @@ fec_enet_interrupt(int irq, void * dev_id)
if (int_events & FEC_ENET_RXF) {
ret = IRQ_HANDLED;
- fec_enet_rx(dev);
+ fec_enet_rx(ndev);
}
/* Transmit OK, or non-fatal error. Update the buffer
@@ -369,7 +369,7 @@ fec_enet_interrupt(int irq, void * dev_id)
*/
if (int_events & FEC_ENET_TXF) {
ret = IRQ_HANDLED;
- fec_enet_tx(dev);
+ fec_enet_tx(ndev);
}
if (int_events & FEC_ENET_MII) {
@@ -383,14 +383,14 @@ fec_enet_interrupt(int irq, void * dev_id)
static void
-fec_enet_tx(struct net_device *dev)
+fec_enet_tx(struct net_device *ndev)
{
struct fec_enet_private *fep;
struct bufdesc *bdp;
unsigned short status;
struct sk_buff *skb;
- fep = netdev_priv(dev);
+ fep = netdev_priv(ndev);
spin_lock(&fep->hw_lock);
bdp = fep->dirty_tx;
@@ -398,7 +398,7 @@ fec_enet_tx(struct net_device *dev)
if (bdp == fep->cur_tx && fep->tx_full == 0)
break;
- dma_unmap_single(&dev->dev, bdp->cbd_bufaddr, FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE);
+ dma_unmap_single(&ndev->dev, bdp->cbd_bufaddr, FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE);
bdp->cbd_bufaddr = 0;
skb = fep->tx_skbuff[fep->skb_dirty];
@@ -406,19 +406,19 @@ fec_enet_tx(struct net_device *dev)
if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC |
BD_ENET_TX_RL | BD_ENET_TX_UN |
BD_ENET_TX_CSL)) {
- dev->stats.tx_errors++;
+ ndev->stats.tx_errors++;
if (status & BD_ENET_TX_HB) /* No heartbeat */
- dev->stats.tx_heartbeat_errors++;
+ ndev->stats.tx_heartbeat_errors++;
if (status & BD_ENET_TX_LC) /* Late collision */
- dev->stats.tx_window_errors++;
+ ndev->stats.tx_window_errors++;
if (status & BD_ENET_TX_RL) /* Retrans limit */
- dev->stats.tx_aborted_errors++;
+ ndev->stats.tx_aborted_errors++;
if (status & BD_ENET_TX_UN) /* Underrun */
- dev->stats.tx_fifo_errors++;
+ ndev->stats.tx_fifo_errors++;
if (status & BD_ENET_TX_CSL) /* Carrier lost */
- dev->stats.tx_carrier_errors++;
+ ndev->stats.tx_carrier_errors++;
} else {
- dev->stats.tx_packets++;
+ ndev->stats.tx_packets++;
}
if (status & BD_ENET_TX_READY)
@@ -428,7 +428,7 @@ fec_enet_tx(struct net_device *dev)
* but we eventually sent the packet OK.
*/
if (status & BD_ENET_TX_DEF)
- dev->stats.collisions++;
+ ndev->stats.collisions++;
/* Free the sk buffer associated with this last transmit */
dev_kfree_skb_any(skb);
@@ -445,8 +445,8 @@ fec_enet_tx(struct net_device *dev)
*/
if (fep->tx_full) {
fep->tx_full = 0;
- if (netif_queue_stopped(dev))
- netif_wake_queue(dev);
+ if (netif_queue_stopped(ndev))
+ netif_wake_queue(ndev);
}
}
fep->dirty_tx = bdp;
@@ -460,9 +460,9 @@ fec_enet_tx(struct net_device *dev)
* effectively tossing the packet.
*/
static void
-fec_enet_rx(struct net_device *dev)
+fec_enet_rx(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
const struct platform_device_id *id_entry =
platform_get_device_id(fep->pdev);
struct bufdesc *bdp;
@@ -496,17 +496,17 @@ fec_enet_rx(struct net_device *dev)
/* Check for errors. */
if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO |
BD_ENET_RX_CR | BD_ENET_RX_OV)) {
- dev->stats.rx_errors++;
+ ndev->stats.rx_errors++;
if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH)) {
/* Frame too long or too short. */
- dev->stats.rx_length_errors++;
+ ndev->stats.rx_length_errors++;
}
if (status & BD_ENET_RX_NO) /* Frame alignment */
- dev->stats.rx_frame_errors++;
+ ndev->stats.rx_frame_errors++;
if (status & BD_ENET_RX_CR) /* CRC Error */
- dev->stats.rx_crc_errors++;
+ ndev->stats.rx_crc_errors++;
if (status & BD_ENET_RX_OV) /* FIFO overrun */
- dev->stats.rx_fifo_errors++;
+ ndev->stats.rx_fifo_errors++;
}
/* Report late collisions as a frame error.
@@ -514,15 +514,15 @@ fec_enet_rx(struct net_device *dev)
* have in the buffer. So, just drop this frame on the floor.
*/
if (status & BD_ENET_RX_CL) {
- dev->stats.rx_errors++;
- dev->stats.rx_frame_errors++;
+ ndev->stats.rx_errors++;
+ ndev->stats.rx_frame_errors++;
goto rx_processing_done;
}
/* Process the incoming frame. */
- dev->stats.rx_packets++;
+ ndev->stats.rx_packets++;
pkt_len = bdp->cbd_datlen;
- dev->stats.rx_bytes += pkt_len;
+ ndev->stats.rx_bytes += pkt_len;
data = (__u8*)__va(bdp->cbd_bufaddr);
dma_unmap_single(NULL, bdp->cbd_bufaddr, bdp->cbd_datlen,
@@ -540,13 +540,13 @@ fec_enet_rx(struct net_device *dev)
if (unlikely(!skb)) {
printk("%s: Memory squeeze, dropping packet.\n",
- dev->name);
- dev->stats.rx_dropped++;
+ ndev->name);
+ ndev->stats.rx_dropped++;
} else {
skb_reserve(skb, NET_IP_ALIGN);
skb_put(skb, pkt_len - 4); /* Make room */
skb_copy_to_linear_data(skb, data, pkt_len - 4);
- skb->protocol = eth_type_trans(skb, dev);
+ skb->protocol = eth_type_trans(skb, ndev);
netif_rx(skb);
}
@@ -577,9 +577,9 @@ rx_processing_done:
}
/* ------------------------------------------------------------------------- */
-static void __inline__ fec_get_mac(struct net_device *dev)
+static void __inline__ fec_get_mac(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
struct fec_platform_data *pdata = fep->pdev->dev.platform_data;
unsigned char *iap, tmpaddr[ETH_ALEN];
@@ -615,11 +615,11 @@ static void __inline__ fec_get_mac(struct net_device *dev)
iap = &tmpaddr[0];
}
- memcpy(dev->dev_addr, iap, ETH_ALEN);
+ memcpy(ndev->dev_addr, iap, ETH_ALEN);
/* Adjust MAC if using macaddr */
if (iap == macaddr)
- dev->dev_addr[ETH_ALEN-1] = macaddr[ETH_ALEN-1] + fep->pdev->id;
+ ndev->dev_addr[ETH_ALEN-1] = macaddr[ETH_ALEN-1] + fep->pdev->id;
}
/* ------------------------------------------------------------------------- */
@@ -627,9 +627,9 @@ static void __inline__ fec_get_mac(struct net_device *dev)
/*
* Phy section
*/
-static void fec_enet_adjust_link(struct net_device *dev)
+static void fec_enet_adjust_link(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
struct phy_device *phy_dev = fep->phy_dev;
unsigned long flags;
@@ -646,7 +646,7 @@ static void fec_enet_adjust_link(struct net_device *dev)
/* Duplex link change */
if (phy_dev->link) {
if (fep->full_duplex != phy_dev->duplex) {
- fec_restart(dev, phy_dev->duplex);
+ fec_restart(ndev, phy_dev->duplex);
status_change = 1;
}
}
@@ -655,9 +655,9 @@ static void fec_enet_adjust_link(struct net_device *dev)
if (phy_dev->link != fep->link) {
fep->link = phy_dev->link;
if (phy_dev->link)
- fec_restart(dev, phy_dev->duplex);
+ fec_restart(ndev, phy_dev->duplex);
else
- fec_stop(dev);
+ fec_stop(ndev);
status_change = 1;
}
@@ -726,9 +726,9 @@ static int fec_enet_mdio_reset(struct mii_bus *bus)
return 0;
}
-static int fec_enet_mii_probe(struct net_device *dev)
+static int fec_enet_mii_probe(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
struct phy_device *phy_dev = NULL;
char mdio_bus_id[MII_BUS_ID_SIZE];
char phy_name[MII_BUS_ID_SIZE + 3];
@@ -753,16 +753,16 @@ static int fec_enet_mii_probe(struct net_device *dev)
if (phy_id >= PHY_MAX_ADDR) {
printk(KERN_INFO "%s: no PHY, assuming direct connection "
- "to switch\n", dev->name);
+ "to switch\n", ndev->name);
strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE);
phy_id = 0;
}
snprintf(phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
- phy_dev = phy_connect(dev, phy_name, &fec_enet_adjust_link, 0,
+ phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link, 0,
PHY_INTERFACE_MODE_MII);
if (IS_ERR(phy_dev)) {
- printk(KERN_ERR "%s: could not attach to PHY\n", dev->name);
+ printk(KERN_ERR "%s: could not attach to PHY\n", ndev->name);
return PTR_ERR(phy_dev);
}
@@ -775,7 +775,7 @@ static int fec_enet_mii_probe(struct net_device *dev)
fep->full_duplex = 0;
printk(KERN_INFO "%s: Freescale FEC PHY driver [%s] "
- "(mii_bus:phy_addr=%s, irq=%d)\n", dev->name,
+ "(mii_bus:phy_addr=%s, irq=%d)\n", ndev->name,
fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
fep->phy_dev->irq);
@@ -785,8 +785,8 @@ static int fec_enet_mii_probe(struct net_device *dev)
static int fec_enet_mii_init(struct platform_device *pdev)
{
static struct mii_bus *fec0_mii_bus;
- struct net_device *dev = platform_get_drvdata(pdev);
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct net_device *ndev = platform_get_drvdata(pdev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
const struct platform_device_id *id_entry =
platform_get_device_id(fep->pdev);
int err = -ENXIO, i;
@@ -844,7 +844,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
for (i = 0; i < PHY_MAX_ADDR; i++)
fep->mii_bus->irq[i] = PHY_POLL;
- platform_set_drvdata(dev, fep->mii_bus);
+ platform_set_drvdata(ndev, fep->mii_bus);
if (mdiobus_register(fep->mii_bus))
goto err_out_free_mdio_irq;
@@ -872,10 +872,10 @@ static void fec_enet_mii_remove(struct fec_enet_private *fep)
mdiobus_free(fep->mii_bus);
}
-static int fec_enet_get_settings(struct net_device *dev,
+static int fec_enet_get_settings(struct net_device *ndev,
struct ethtool_cmd *cmd)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
struct phy_device *phydev = fep->phy_dev;
if (!phydev)
@@ -884,10 +884,10 @@ static int fec_enet_get_settings(struct net_device *dev,
return phy_ethtool_gset(phydev, cmd);
}
-static int fec_enet_set_settings(struct net_device *dev,
+static int fec_enet_set_settings(struct net_device *ndev,
struct ethtool_cmd *cmd)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
struct phy_device *phydev = fep->phy_dev;
if (!phydev)
@@ -896,14 +896,14 @@ static int fec_enet_set_settings(struct net_device *dev,
return phy_ethtool_sset(phydev, cmd);
}
-static void fec_enet_get_drvinfo(struct net_device *dev,
+static void fec_enet_get_drvinfo(struct net_device *ndev,
struct ethtool_drvinfo *info)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
strcpy(info->driver, fep->pdev->dev.driver->name);
strcpy(info->version, "Revision: 1.0");
- strcpy(info->bus_info, dev_name(&dev->dev));
+ strcpy(info->bus_info, dev_name(&ndev->dev));
}
static struct ethtool_ops fec_enet_ethtool_ops = {
@@ -913,12 +913,12 @@ static struct ethtool_ops fec_enet_ethtool_ops = {
.get_link = ethtool_op_get_link,
};
-static int fec_enet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
struct phy_device *phydev = fep->phy_dev;
- if (!netif_running(dev))
+ if (!netif_running(ndev))
return -EINVAL;
if (!phydev)
@@ -927,9 +927,9 @@ static int fec_enet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
return phy_mii_ioctl(phydev, rq, cmd);
}
-static void fec_enet_free_buffers(struct net_device *dev)
+static void fec_enet_free_buffers(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
int i;
struct sk_buff *skb;
struct bufdesc *bdp;
@@ -939,7 +939,7 @@ static void fec_enet_free_buffers(struct net_device *dev)
skb = fep->rx_skbuff[i];
if (bdp->cbd_bufaddr)
- dma_unmap_single(&dev->dev, bdp->cbd_bufaddr,
+ dma_unmap_single(&ndev->dev, bdp->cbd_bufaddr,
FEC_ENET_RX_FRSIZE, DMA_FROM_DEVICE);
if (skb)
dev_kfree_skb(skb);
@@ -951,9 +951,9 @@ static void fec_enet_free_buffers(struct net_device *dev)
kfree(fep->tx_bounce[i]);
}
-static int fec_enet_alloc_buffers(struct net_device *dev)
+static int fec_enet_alloc_buffers(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
int i;
struct sk_buff *skb;
struct bufdesc *bdp;
@@ -962,12 +962,12 @@ static int fec_enet_alloc_buffers(struct net_device *dev)
for (i = 0; i < RX_RING_SIZE; i++) {
skb = dev_alloc_skb(FEC_ENET_RX_FRSIZE);
if (!skb) {
- fec_enet_free_buffers(dev);
+ fec_enet_free_buffers(ndev);
return -ENOMEM;
}
fep->rx_skbuff[i] = skb;
- bdp->cbd_bufaddr = dma_map_single(&dev->dev, skb->data,
+ bdp->cbd_bufaddr = dma_map_single(&ndev->dev, skb->data,
FEC_ENET_RX_FRSIZE, DMA_FROM_DEVICE);
bdp->cbd_sc = BD_ENET_RX_EMPTY;
bdp++;
@@ -994,47 +994,47 @@ static int fec_enet_alloc_buffers(struct net_device *dev)
}
static int
-fec_enet_open(struct net_device *dev)
+fec_enet_open(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
int ret;
/* I should reset the ring buffers here, but I don't yet know
* a simple way to do that.
*/
- ret = fec_enet_alloc_buffers(dev);
+ ret = fec_enet_alloc_buffers(ndev);
if (ret)
return ret;
/* Probe and connect to PHY when open the interface */
- ret = fec_enet_mii_probe(dev);
+ ret = fec_enet_mii_probe(ndev);
if (ret) {
- fec_enet_free_buffers(dev);
+ fec_enet_free_buffers(ndev);
return ret;
}
phy_start(fep->phy_dev);
- netif_start_queue(dev);
+ netif_start_queue(ndev);
fep->opened = 1;
return 0;
}
static int
-fec_enet_close(struct net_device *dev)
+fec_enet_close(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
/* Don't know what to do yet. */
fep->opened = 0;
- netif_stop_queue(dev);
- fec_stop(dev);
+ netif_stop_queue(ndev);
+ fec_stop(ndev);
if (fep->phy_dev) {
phy_stop(fep->phy_dev);
phy_disconnect(fep->phy_dev);
}
- fec_enet_free_buffers(dev);
+ fec_enet_free_buffers(ndev);
return 0;
}
@@ -1052,14 +1052,14 @@ fec_enet_close(struct net_device *dev)
#define HASH_BITS 6 /* #bits in hash */
#define CRC32_POLY 0xEDB88320
-static void set_multicast_list(struct net_device *dev)
+static void set_multicast_list(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
struct netdev_hw_addr *ha;
unsigned int i, bit, data, crc, tmp;
unsigned char hash;
- if (dev->flags & IFF_PROMISC) {
+ if (ndev->flags & IFF_PROMISC) {
tmp = readl(fep->hwp + FEC_R_CNTRL);
tmp |= 0x8;
writel(tmp, fep->hwp + FEC_R_CNTRL);
@@ -1070,7 +1070,7 @@ static void set_multicast_list(struct net_device *dev)
tmp &= ~0x8;
writel(tmp, fep->hwp + FEC_R_CNTRL);
- if (dev->flags & IFF_ALLMULTI) {
+ if (ndev->flags & IFF_ALLMULTI) {
/* Catch all multicast addresses, so set the
* filter to all 1's
*/
@@ -1085,7 +1085,7 @@ static void set_multicast_list(struct net_device *dev)
writel(0, fep->hwp + FEC_GRP_HASH_TABLE_HIGH);
writel(0, fep->hwp + FEC_GRP_HASH_TABLE_LOW);
- netdev_for_each_mc_addr(ha, dev) {
+ netdev_for_each_mc_addr(ha, ndev) {
/* Only support group multicast for now */
if (!(ha->addr[0] & 1))
continue;
@@ -1093,7 +1093,7 @@ static void set_multicast_list(struct net_device *dev)
/* calculate crc32 value of mac address */
crc = 0xffffffff;
- for (i = 0; i < dev->addr_len; i++) {
+ for (i = 0; i < ndev->addr_len; i++) {
data = ha->addr[i];
for (bit = 0; bit < 8; bit++, data >>= 1) {
crc = (crc >> 1) ^
@@ -1120,20 +1120,20 @@ static void set_multicast_list(struct net_device *dev)
/* Set a MAC change in hardware. */
static int
-fec_set_mac_address(struct net_device *dev, void *p)
+fec_set_mac_address(struct net_device *ndev, void *p)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
struct sockaddr *addr = p;
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
- memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+ memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
- writel(dev->dev_addr[3] | (dev->dev_addr[2] << 8) |
- (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24),
+ writel(ndev->dev_addr[3] | (ndev->dev_addr[2] << 8) |
+ (ndev->dev_addr[1] << 16) | (ndev->dev_addr[0] << 24),
fep->hwp + FEC_ADDR_LOW);
- writel((dev->dev_addr[5] << 16) | (dev->dev_addr[4] << 24),
+ writel((ndev->dev_addr[5] << 16) | (ndev->dev_addr[4] << 24),
fep->hwp + FEC_ADDR_HIGH);
return 0;
}
@@ -1154,9 +1154,9 @@ static const struct net_device_ops fec_netdev_ops = {
* XXX: We need to clean up on failure exits here.
*
*/
-static int fec_enet_init(struct net_device *dev)
+static int fec_enet_init(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
struct bufdesc *cbd_base;
struct bufdesc *bdp;
int i;
@@ -1171,19 +1171,19 @@ static int fec_enet_init(struct net_device *dev)
spin_lock_init(&fep->hw_lock);
- fep->netdev = dev;
+ fep->netdev = ndev;
/* Get the Ethernet address */
- fec_get_mac(dev);
+ fec_get_mac(ndev);
/* Set receive and transmit descriptor base. */
fep->rx_bd_base = cbd_base;
fep->tx_bd_base = cbd_base + RX_RING_SIZE;
/* The FEC Ethernet specific entries in the device structure */
- dev->watchdog_timeo = TX_TIMEOUT;
- dev->netdev_ops = &fec_netdev_ops;
- dev->ethtool_ops = &fec_enet_ethtool_ops;
+ ndev->watchdog_timeo = TX_TIMEOUT;
+ ndev->netdev_ops = &fec_netdev_ops;
+ ndev->ethtool_ops = &fec_enet_ethtool_ops;
/* Initialize the receive buffer descriptors. */
bdp = fep->rx_bd_base;
@@ -1212,7 +1212,7 @@ static int fec_enet_init(struct net_device *dev)
bdp--;
bdp->cbd_sc |= BD_SC_WRAP;
- fec_restart(dev, 0);
+ fec_restart(ndev, 0);
return 0;
}
@@ -1222,9 +1222,9 @@ static int fec_enet_init(struct net_device *dev)
* duplex.
*/
static void
-fec_restart(struct net_device *dev, int duplex)
+fec_restart(struct net_device *ndev, int duplex)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
const struct platform_device_id *id_entry =
platform_get_device_id(fep->pdev);
int i;
@@ -1239,7 +1239,7 @@ fec_restart(struct net_device *dev, int duplex)
* so need to reconfigure it.
*/
if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) {
- memcpy(&temp_mac, dev->dev_addr, ETH_ALEN);
+ memcpy(&temp_mac, ndev->dev_addr, ETH_ALEN);
writel(cpu_to_be32(temp_mac[0]), fep->hwp + FEC_ADDR_LOW);
writel(cpu_to_be32(temp_mac[1]), fep->hwp + FEC_ADDR_HIGH);
}
@@ -1339,9 +1339,9 @@ fec_restart(struct net_device *dev, int duplex)
}
static void
-fec_stop(struct net_device *dev)
+fec_stop(struct net_device *ndev)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
/* We cannot expect a graceful transmit stop without link !!! */
if (fep->link) {
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 10/14] net/fec: some whitespace cleanup
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
` (7 preceding siblings ...)
2011-02-11 10:32 ` [PATCH 09/14] net/fec: consistenly name struct net_device pointers "ndev" Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 11/14] net/fec: reorder functions a bit allows removing forward declarations Uwe Kleine-König
` (4 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
A few of these were found and reported by Lothar Waßmann.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index c70503a..4c888f1 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -182,7 +182,7 @@ struct fec_enet_private {
struct bufdesc *rx_bd_base;
struct bufdesc *tx_bd_base;
/* The next free ring entry */
- struct bufdesc *cur_rx, *cur_tx;
+ struct bufdesc *cur_rx, *cur_tx;
/* The ring entries to be free()ed */
struct bufdesc *dirty_tx;
@@ -190,15 +190,15 @@ struct fec_enet_private {
/* hold while accessing the HW like ringbuffer for tx/rx but not MAC */
spinlock_t hw_lock;
- struct platform_device *pdev;
+ struct platform_device *pdev;
int opened;
/* Phylib and MDIO interface */
- struct mii_bus *mii_bus;
- struct phy_device *phy_dev;
- int mii_timeout;
- uint phy_speed;
+ struct mii_bus *mii_bus;
+ struct phy_device *phy_dev;
+ int mii_timeout;
+ uint phy_speed;
phy_interface_t phy_interface;
int link;
int full_duplex;
@@ -525,8 +525,8 @@ fec_enet_rx(struct net_device *ndev)
ndev->stats.rx_bytes += pkt_len;
data = (__u8*)__va(bdp->cbd_bufaddr);
- dma_unmap_single(NULL, bdp->cbd_bufaddr, bdp->cbd_datlen,
- DMA_FROM_DEVICE);
+ dma_unmap_single(NULL, bdp->cbd_bufaddr, bdp->cbd_datlen,
+ DMA_FROM_DEVICE);
if (id_entry->driver_data & FEC_QUIRK_SWAP_FRAME)
swap_buffer(data, pkt_len);
@@ -550,7 +550,7 @@ fec_enet_rx(struct net_device *ndev)
netif_rx(skb);
}
- bdp->cbd_bufaddr = dma_map_single(NULL, data, bdp->cbd_datlen,
+ bdp->cbd_bufaddr = dma_map_single(NULL, data, bdp->cbd_datlen,
DMA_FROM_DEVICE);
rx_processing_done:
/* Clear the status flags for this buffer */
@@ -1034,7 +1034,7 @@ fec_enet_close(struct net_device *ndev)
phy_disconnect(fep->phy_dev);
}
- fec_enet_free_buffers(ndev);
+ fec_enet_free_buffers(ndev);
return 0;
}
@@ -1147,7 +1147,7 @@ static const struct net_device_ops fec_netdev_ops = {
.ndo_validate_addr = eth_validate_addr,
.ndo_tx_timeout = fec_timeout,
.ndo_set_mac_address = fec_set_mac_address,
- .ndo_do_ioctl = fec_enet_ioctl,
+ .ndo_do_ioctl = fec_enet_ioctl,
};
/*
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 11/14] net/fec: reorder functions a bit allows removing forward declarations
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
` (8 preceding siblings ...)
2011-02-11 10:32 ` [PATCH 10/14] net/fec: some whitespace cleanup Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 12/14] net/fec: provide device for dma functions and matching sizes for map and unmap Uwe Kleine-König
` (3 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 353 ++++++++++++++++++++++++++---------------------------
1 files changed, 174 insertions(+), 179 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 4c888f1..3f5dfe2 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -205,13 +205,6 @@ struct fec_enet_private {
struct completion mdio_done;
};
-static irqreturn_t fec_enet_interrupt(int irq, void * dev_id);
-static void fec_enet_tx(struct net_device *ndev);
-static void fec_enet_rx(struct net_device *ndev);
-static int fec_enet_close(struct net_device *ndev);
-static void fec_restart(struct net_device *ndev, int duplex);
-static void fec_stop(struct net_device *ndev);
-
/* FEC MII MMFR bits definition */
#define FEC_MMFR_ST (1 << 30)
#define FEC_MMFR_OP_READ (2 << 28)
@@ -335,54 +328,160 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
return NETDEV_TX_OK;
}
+/* This function is called to start or restart the FEC during a link
+ * change. This only happens when switching between half and full
+ * duplex.
+ */
static void
-fec_timeout(struct net_device *ndev)
+fec_restart(struct net_device *ndev, int duplex)
{
struct fec_enet_private *fep = netdev_priv(ndev);
+ const struct platform_device_id *id_entry =
+ platform_get_device_id(fep->pdev);
+ int i;
+ u32 val, temp_mac[2];
- ndev->stats.tx_errors++;
+ /* Whack a reset. We should wait for this. */
+ writel(1, fep->hwp + FEC_ECNTRL);
+ udelay(10);
- fec_restart(ndev, fep->full_duplex);
- netif_wake_queue(ndev);
-}
+ /*
+ * enet-mac reset will reset mac address registers too,
+ * so need to reconfigure it.
+ */
+ if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) {
+ memcpy(&temp_mac, ndev->dev_addr, ETH_ALEN);
+ writel(cpu_to_be32(temp_mac[0]), fep->hwp + FEC_ADDR_LOW);
+ writel(cpu_to_be32(temp_mac[1]), fep->hwp + FEC_ADDR_HIGH);
+ }
-static irqreturn_t
-fec_enet_interrupt(int irq, void *dev_id)
-{
- struct net_device *ndev = dev_id;
- struct fec_enet_private *fep = netdev_priv(ndev);
- uint int_events;
- irqreturn_t ret = IRQ_NONE;
+ /* Clear any outstanding interrupt. */
+ writel(0xffc00000, fep->hwp + FEC_IEVENT);
- do {
- int_events = readl(fep->hwp + FEC_IEVENT);
- writel(int_events, fep->hwp + FEC_IEVENT);
+ /* Reset all multicast. */
+ writel(0, fep->hwp + FEC_GRP_HASH_TABLE_HIGH);
+ writel(0, fep->hwp + FEC_GRP_HASH_TABLE_LOW);
+#ifndef CONFIG_M5272
+ writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
+ writel(0, fep->hwp + FEC_HASH_TABLE_LOW);
+#endif
- if (int_events & FEC_ENET_RXF) {
- ret = IRQ_HANDLED;
- fec_enet_rx(ndev);
- }
+ /* Set maximum receive buffer size. */
+ writel(PKT_MAXBLR_SIZE, fep->hwp + FEC_R_BUFF_SIZE);
- /* Transmit OK, or non-fatal error. Update the buffer
- * descriptors. FEC handles all errors, we just discover
- * them as part of the transmit process.
- */
- if (int_events & FEC_ENET_TXF) {
- ret = IRQ_HANDLED;
- fec_enet_tx(ndev);
+ /* Set receive and transmit descriptor base. */
+ writel(fep->bd_dma, fep->hwp + FEC_R_DES_START);
+ writel((unsigned long)fep->bd_dma + sizeof(struct bufdesc) * RX_RING_SIZE,
+ fep->hwp + FEC_X_DES_START);
+
+ fep->dirty_tx = fep->cur_tx = fep->tx_bd_base;
+ fep->cur_rx = fep->rx_bd_base;
+
+ /* Reset SKB transmit buffers. */
+ fep->skb_cur = fep->skb_dirty = 0;
+ for (i = 0; i <= TX_RING_MOD_MASK; i++) {
+ if (fep->tx_skbuff[i]) {
+ dev_kfree_skb_any(fep->tx_skbuff[i]);
+ fep->tx_skbuff[i] = NULL;
}
+ }
- if (int_events & FEC_ENET_MII) {
- ret = IRQ_HANDLED;
- complete(&fep->mdio_done);
+ /* Enable MII mode */
+ if (duplex) {
+ /* MII enable / FD enable */
+ writel(OPT_FRAME_SIZE | 0x04, fep->hwp + FEC_R_CNTRL);
+ writel(0x04, fep->hwp + FEC_X_CNTRL);
+ } else {
+ /* MII enable / No Rcv on Xmit */
+ writel(OPT_FRAME_SIZE | 0x06, fep->hwp + FEC_R_CNTRL);
+ writel(0x0, fep->hwp + FEC_X_CNTRL);
+ }
+ fep->full_duplex = duplex;
+
+ /* Set MII speed */
+ writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
+
+ /*
+ * The phy interface and speed need to get configured
+ * differently on enet-mac.
+ */
+ if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) {
+ val = readl(fep->hwp + FEC_R_CNTRL);
+
+ /* MII or RMII */
+ if (fep->phy_interface == PHY_INTERFACE_MODE_RMII)
+ val |= (1 << 8);
+ else
+ val &= ~(1 << 8);
+
+ /* 10M or 100M */
+ if (fep->phy_dev && fep->phy_dev->speed == SPEED_100)
+ val &= ~(1 << 9);
+ else
+ val |= (1 << 9);
+
+ writel(val, fep->hwp + FEC_R_CNTRL);
+ } else {
+#ifdef FEC_MIIGSK_ENR
+ if (fep->phy_interface == PHY_INTERFACE_MODE_RMII) {
+ /* disable the gasket and wait */
+ writel(0, fep->hwp + FEC_MIIGSK_ENR);
+ while (readl(fep->hwp + FEC_MIIGSK_ENR) & 4)
+ udelay(1);
+
+ /*
+ * configure the gasket:
+ * RMII, 50 MHz, no loopback, no echo
+ */
+ writel(1, fep->hwp + FEC_MIIGSK_CFGR);
+
+ /* re-enable the gasket */
+ writel(2, fep->hwp + FEC_MIIGSK_ENR);
}
- } while (int_events);
+#endif
+ }
- return ret;
+ /* And last, enable the transmit and receive processing */
+ writel(2, fep->hwp + FEC_ECNTRL);
+ writel(0, fep->hwp + FEC_R_DES_ACTIVE);
+
+ /* Enable interrupts we wish to service */
+ writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
+}
+
+static void
+fec_stop(struct net_device *ndev)
+{
+ struct fec_enet_private *fep = netdev_priv(ndev);
+
+ /* We cannot expect a graceful transmit stop without link !!! */
+ if (fep->link) {
+ writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */
+ udelay(10);
+ if (!(readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA))
+ printk("fec_stop : Graceful transmit stop did not complete !\n");
+ }
+
+ /* Whack a reset. We should wait for this. */
+ writel(1, fep->hwp + FEC_ECNTRL);
+ udelay(10);
+ writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
+ writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
}
static void
+fec_timeout(struct net_device *ndev)
+{
+ struct fec_enet_private *fep = netdev_priv(ndev);
+
+ ndev->stats.tx_errors++;
+
+ fec_restart(ndev, fep->full_duplex);
+ netif_wake_queue(ndev);
+}
+
+static void
fec_enet_tx(struct net_device *ndev)
{
struct fec_enet_private *fep;
@@ -576,6 +675,43 @@ rx_processing_done:
spin_unlock(&fep->hw_lock);
}
+static irqreturn_t
+fec_enet_interrupt(int irq, void *dev_id)
+{
+ struct net_device *ndev = dev_id;
+ struct fec_enet_private *fep = netdev_priv(ndev);
+ uint int_events;
+ irqreturn_t ret = IRQ_NONE;
+
+ do {
+ int_events = readl(fep->hwp + FEC_IEVENT);
+ writel(int_events, fep->hwp + FEC_IEVENT);
+
+ if (int_events & FEC_ENET_RXF) {
+ ret = IRQ_HANDLED;
+ fec_enet_rx(ndev);
+ }
+
+ /* Transmit OK, or non-fatal error. Update the buffer
+ * descriptors. FEC handles all errors, we just discover
+ * them as part of the transmit process.
+ */
+ if (int_events & FEC_ENET_TXF) {
+ ret = IRQ_HANDLED;
+ fec_enet_tx(ndev);
+ }
+
+ if (int_events & FEC_ENET_MII) {
+ ret = IRQ_HANDLED;
+ complete(&fep->mdio_done);
+ }
+ } while (int_events);
+
+ return ret;
+}
+
+
+
/* ------------------------------------------------------------------------- */
static void __inline__ fec_get_mac(struct net_device *ndev)
{
@@ -1217,147 +1353,6 @@ static int fec_enet_init(struct net_device *ndev)
return 0;
}
-/* This function is called to start or restart the FEC during a link
- * change. This only happens when switching between half and full
- * duplex.
- */
-static void
-fec_restart(struct net_device *ndev, int duplex)
-{
- struct fec_enet_private *fep = netdev_priv(ndev);
- const struct platform_device_id *id_entry =
- platform_get_device_id(fep->pdev);
- int i;
- u32 val, temp_mac[2];
-
- /* Whack a reset. We should wait for this. */
- writel(1, fep->hwp + FEC_ECNTRL);
- udelay(10);
-
- /*
- * enet-mac reset will reset mac address registers too,
- * so need to reconfigure it.
- */
- if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) {
- memcpy(&temp_mac, ndev->dev_addr, ETH_ALEN);
- writel(cpu_to_be32(temp_mac[0]), fep->hwp + FEC_ADDR_LOW);
- writel(cpu_to_be32(temp_mac[1]), fep->hwp + FEC_ADDR_HIGH);
- }
-
- /* Clear any outstanding interrupt. */
- writel(0xffc00000, fep->hwp + FEC_IEVENT);
-
- /* Reset all multicast. */
- writel(0, fep->hwp + FEC_GRP_HASH_TABLE_HIGH);
- writel(0, fep->hwp + FEC_GRP_HASH_TABLE_LOW);
-#ifndef CONFIG_M5272
- writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
- writel(0, fep->hwp + FEC_HASH_TABLE_LOW);
-#endif
-
- /* Set maximum receive buffer size. */
- writel(PKT_MAXBLR_SIZE, fep->hwp + FEC_R_BUFF_SIZE);
-
- /* Set receive and transmit descriptor base. */
- writel(fep->bd_dma, fep->hwp + FEC_R_DES_START);
- writel((unsigned long)fep->bd_dma + sizeof(struct bufdesc) * RX_RING_SIZE,
- fep->hwp + FEC_X_DES_START);
-
- fep->dirty_tx = fep->cur_tx = fep->tx_bd_base;
- fep->cur_rx = fep->rx_bd_base;
-
- /* Reset SKB transmit buffers. */
- fep->skb_cur = fep->skb_dirty = 0;
- for (i = 0; i <= TX_RING_MOD_MASK; i++) {
- if (fep->tx_skbuff[i]) {
- dev_kfree_skb_any(fep->tx_skbuff[i]);
- fep->tx_skbuff[i] = NULL;
- }
- }
-
- /* Enable MII mode */
- if (duplex) {
- /* MII enable / FD enable */
- writel(OPT_FRAME_SIZE | 0x04, fep->hwp + FEC_R_CNTRL);
- writel(0x04, fep->hwp + FEC_X_CNTRL);
- } else {
- /* MII enable / No Rcv on Xmit */
- writel(OPT_FRAME_SIZE | 0x06, fep->hwp + FEC_R_CNTRL);
- writel(0x0, fep->hwp + FEC_X_CNTRL);
- }
- fep->full_duplex = duplex;
-
- /* Set MII speed */
- writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
-
- /*
- * The phy interface and speed need to get configured
- * differently on enet-mac.
- */
- if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) {
- val = readl(fep->hwp + FEC_R_CNTRL);
-
- /* MII or RMII */
- if (fep->phy_interface == PHY_INTERFACE_MODE_RMII)
- val |= (1 << 8);
- else
- val &= ~(1 << 8);
-
- /* 10M or 100M */
- if (fep->phy_dev && fep->phy_dev->speed == SPEED_100)
- val &= ~(1 << 9);
- else
- val |= (1 << 9);
-
- writel(val, fep->hwp + FEC_R_CNTRL);
- } else {
-#ifdef FEC_MIIGSK_ENR
- if (fep->phy_interface == PHY_INTERFACE_MODE_RMII) {
- /* disable the gasket and wait */
- writel(0, fep->hwp + FEC_MIIGSK_ENR);
- while (readl(fep->hwp + FEC_MIIGSK_ENR) & 4)
- udelay(1);
-
- /*
- * configure the gasket:
- * RMII, 50 MHz, no loopback, no echo
- */
- writel(1, fep->hwp + FEC_MIIGSK_CFGR);
-
- /* re-enable the gasket */
- writel(2, fep->hwp + FEC_MIIGSK_ENR);
- }
-#endif
- }
-
- /* And last, enable the transmit and receive processing */
- writel(2, fep->hwp + FEC_ECNTRL);
- writel(0, fep->hwp + FEC_R_DES_ACTIVE);
-
- /* Enable interrupts we wish to service */
- writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
-}
-
-static void
-fec_stop(struct net_device *ndev)
-{
- struct fec_enet_private *fep = netdev_priv(ndev);
-
- /* We cannot expect a graceful transmit stop without link !!! */
- if (fep->link) {
- writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */
- udelay(10);
- if (!(readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA))
- printk("fec_stop : Graceful transmit stop did not complete !\n");
- }
-
- /* Whack a reset. We should wait for this. */
- writel(1, fep->hwp + FEC_ECNTRL);
- udelay(10);
- writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
- writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
-}
-
static int __devinit
fec_probe(struct platform_device *pdev)
{
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 12/14] net/fec: provide device for dma functions and matching sizes for map and unmap
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
` (9 preceding siblings ...)
2011-02-11 10:32 ` [PATCH 11/14] net/fec: reorder functions a bit allows removing forward declarations Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 13/14] net/fec: postpone unsetting driver data until the hardware is stopped Uwe Kleine-König
` (2 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
This fixes warnings when CONFIG_DMA_API_DEBUG=y:
NULL NULL: DMA-API: device driver tries to free DMA memory it has not allocated [device address=0x000000004781a020] [size=64 bytes]
net eth0: DMA-API: device driver frees DMA memory with different size [device address=0x000000004781a020] [map size=2048 bytes] [unmap size=64 bytes]
Moreover pass the platform device to dma_{,un}map_single which makes
more sense because the logical network device doesn't know anything
about dma.
Passing the platform device was a suggestion by Lothar Waßmann.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 3f5dfe2..0c984d6 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -297,7 +297,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
/* Push the data cache so the CPM does not get stale memory
* data.
*/
- bdp->cbd_bufaddr = dma_map_single(&ndev->dev, bufaddr,
+ bdp->cbd_bufaddr = dma_map_single(&fep->pdev->dev, bufaddr,
FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE);
/* Send it on its way. Tell FEC it's ready, interrupt when done,
@@ -497,7 +497,8 @@ fec_enet_tx(struct net_device *ndev)
if (bdp == fep->cur_tx && fep->tx_full == 0)
break;
- dma_unmap_single(&ndev->dev, bdp->cbd_bufaddr, FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE);
+ dma_unmap_single(&fep->pdev->dev, bdp->cbd_bufaddr,
+ FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE);
bdp->cbd_bufaddr = 0;
skb = fep->tx_skbuff[fep->skb_dirty];
@@ -624,8 +625,8 @@ fec_enet_rx(struct net_device *ndev)
ndev->stats.rx_bytes += pkt_len;
data = (__u8*)__va(bdp->cbd_bufaddr);
- dma_unmap_single(NULL, bdp->cbd_bufaddr, bdp->cbd_datlen,
- DMA_FROM_DEVICE);
+ dma_unmap_single(&fep->pdev->dev, bdp->cbd_bufaddr,
+ FEC_ENET_TX_FRSIZE, DMA_FROM_DEVICE);
if (id_entry->driver_data & FEC_QUIRK_SWAP_FRAME)
swap_buffer(data, pkt_len);
@@ -649,8 +650,8 @@ fec_enet_rx(struct net_device *ndev)
netif_rx(skb);
}
- bdp->cbd_bufaddr = dma_map_single(NULL, data, bdp->cbd_datlen,
- DMA_FROM_DEVICE);
+ bdp->cbd_bufaddr = dma_map_single(&fep->pdev->dev, data,
+ FEC_ENET_TX_FRSIZE, DMA_FROM_DEVICE);
rx_processing_done:
/* Clear the status flags for this buffer */
status &= ~BD_ENET_RX_STATS;
@@ -1075,7 +1076,7 @@ static void fec_enet_free_buffers(struct net_device *ndev)
skb = fep->rx_skbuff[i];
if (bdp->cbd_bufaddr)
- dma_unmap_single(&ndev->dev, bdp->cbd_bufaddr,
+ dma_unmap_single(&fep->pdev->dev, bdp->cbd_bufaddr,
FEC_ENET_RX_FRSIZE, DMA_FROM_DEVICE);
if (skb)
dev_kfree_skb(skb);
@@ -1103,7 +1104,7 @@ static int fec_enet_alloc_buffers(struct net_device *ndev)
}
fep->rx_skbuff[i] = skb;
- bdp->cbd_bufaddr = dma_map_single(&ndev->dev, skb->data,
+ bdp->cbd_bufaddr = dma_map_single(&fep->pdev->dev, skb->data,
FEC_ENET_RX_FRSIZE, DMA_FROM_DEVICE);
bdp->cbd_sc = BD_ENET_RX_EMPTY;
bdp++;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 13/14] net/fec: postpone unsetting driver data until the hardware is stopped
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
` (10 preceding siblings ...)
2011-02-11 10:32 ` [PATCH 12/14] net/fec: provide device for dma functions and matching sizes for map and unmap Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 14/14] net/fec: enable flow control and length check on enet-mac Uwe Kleine-König
2011-02-17 22:32 ` [PATCH 15/14] net/fec: remove unused driver data Uwe Kleine-König
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
Noticed-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 0c984d6..c322971 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1465,8 +1465,6 @@ fec_drv_remove(struct platform_device *pdev)
struct fec_enet_private *fep = netdev_priv(ndev);
struct resource *r;
- platform_set_drvdata(pdev, NULL);
-
fec_stop(ndev);
fec_enet_mii_remove(fep);
clk_disable(fep->clk);
@@ -1479,6 +1477,8 @@ fec_drv_remove(struct platform_device *pdev)
BUG_ON(!r);
release_mem_region(r->start, resource_size(r));
+ platform_set_drvdata(pdev, NULL);
+
return 0;
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 14/14] net/fec: enable flow control and length check on enet-mac
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
` (11 preceding siblings ...)
2011-02-11 10:32 ` [PATCH 13/14] net/fec: postpone unsetting driver data until the hardware is stopped Uwe Kleine-König
@ 2011-02-11 10:32 ` Uwe Kleine-König
2011-02-17 22:32 ` [PATCH 15/14] net/fec: remove unused driver data Uwe Kleine-König
13 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 10:32 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
Also optimize not to reread the value written to FEC_R_CNTRL.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/fec.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index c322971..74798be 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -339,7 +339,8 @@ fec_restart(struct net_device *ndev, int duplex)
const struct platform_device_id *id_entry =
platform_get_device_id(fep->pdev);
int i;
- u32 val, temp_mac[2];
+ u32 temp_mac[2];
+ u32 rcntl = OPT_FRAME_SIZE | 0x04;
/* Whack a reset. We should wait for this. */
writel(1, fep->hwp + FEC_ECNTRL);
@@ -388,14 +389,14 @@ fec_restart(struct net_device *ndev, int duplex)
/* Enable MII mode */
if (duplex) {
- /* MII enable / FD enable */
- writel(OPT_FRAME_SIZE | 0x04, fep->hwp + FEC_R_CNTRL);
+ /* FD enable */
writel(0x04, fep->hwp + FEC_X_CNTRL);
} else {
- /* MII enable / No Rcv on Xmit */
- writel(OPT_FRAME_SIZE | 0x06, fep->hwp + FEC_R_CNTRL);
+ /* No Rcv on Xmit */
+ rcntl |= 0x02;
writel(0x0, fep->hwp + FEC_X_CNTRL);
}
+
fep->full_duplex = duplex;
/* Set MII speed */
@@ -406,21 +407,21 @@ fec_restart(struct net_device *ndev, int duplex)
* differently on enet-mac.
*/
if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) {
- val = readl(fep->hwp + FEC_R_CNTRL);
+ /* Enable flow control and length check */
+ rcntl |= 0x40000000 | 0x00000020;
/* MII or RMII */
if (fep->phy_interface == PHY_INTERFACE_MODE_RMII)
- val |= (1 << 8);
+ rcntl |= (1 << 8);
else
- val &= ~(1 << 8);
+ rcntl &= ~(1 << 8);
/* 10M or 100M */
if (fep->phy_dev && fep->phy_dev->speed == SPEED_100)
- val &= ~(1 << 9);
+ rcntl &= ~(1 << 9);
else
- val |= (1 << 9);
+ rcntl |= (1 << 9);
- writel(val, fep->hwp + FEC_R_CNTRL);
} else {
#ifdef FEC_MIIGSK_ENR
if (fep->phy_interface == PHY_INTERFACE_MODE_RMII) {
@@ -440,6 +441,7 @@ fec_restart(struct net_device *ndev, int duplex)
}
#endif
}
+ writel(rcntl, fep->hwp + FEC_R_CNTRL);
/* And last, enable the transmit and receive processing */
writel(2, fep->hwp + FEC_ECNTRL);
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove
2011-02-11 10:32 ` [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove Uwe Kleine-König
@ 2011-02-11 11:03 ` Uwe Kleine-König
2011-02-12 5:25 ` David Miller
0 siblings, 1 reply; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-11 11:03 UTC (permalink / raw)
To: netdev; +Cc: Shawn Guo, kernel
Hello,
On Fri, Feb 11, 2011 at 11:32:10AM +0100, Uwe Kleine-König wrote:
> Noticed-by: Lothar Waßmann <LW@KARO-electronics.de>
I changed that to Reported-by: in this and the other patches.
(this was Reported-by: Wolfram Sang via irc). The updated patches can
be found at
git://git.pengutronix.de/git/ukl/linux-2.6.git fec
.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove
2011-02-11 11:03 ` Uwe Kleine-König
@ 2011-02-12 5:25 ` David Miller
2011-02-13 21:07 ` Uwe Kleine-König
0 siblings, 1 reply; 25+ messages in thread
From: David Miller @ 2011-02-12 5:25 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, shawn.guo, kernel
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Fri, 11 Feb 2011 12:03:39 +0100
> Hello,
>
> On Fri, Feb 11, 2011 at 11:32:10AM +0100, Uwe Kleine-König wrote:
>> Noticed-by: Lothar Waßmann <LW@KARO-electronics.de>
> I changed that to Reported-by: in this and the other patches.
> (this was Reported-by: Wolfram Sang via irc). The updated patches can
> be found at
>
> git://git.pengutronix.de/git/ukl/linux-2.6.git fec
I can't pull from that tree because it is _NOT_ based upon net-next-2.6
and therefore brings in all kinds of commits not related to your work.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove
2011-02-12 5:25 ` David Miller
@ 2011-02-13 21:07 ` Uwe Kleine-König
2011-02-13 21:15 ` David Miller
0 siblings, 1 reply; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-13 21:07 UTC (permalink / raw)
To: David Miller; +Cc: netdev, shawn.guo, kernel
Hi David,
On Fri, Feb 11, 2011 at 09:25:32PM -0800, David Miller wrote:
> I can't pull from that tree because it is _NOT_ based upon net-next-2.6
> and therefore brings in all kinds of commits not related to your work.
Sorry, I'm not used to the customs on netdev. I can rebase, but still I
wonder about the reason you cannot pull for. The only reason I can
imagine is that you fear unrelated breakage when taking these patches
that are already in Linus' tree. But if it's that, wouldn't it be great
the realize this breakage already now and not only during the next merge
window?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove
2011-02-13 21:07 ` Uwe Kleine-König
@ 2011-02-13 21:15 ` David Miller
2011-02-14 8:25 ` Uwe Kleine-König
0 siblings, 1 reply; 25+ messages in thread
From: David Miller @ 2011-02-13 21:15 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, shawn.guo, kernel
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Sun, 13 Feb 2011 22:07:09 +0100
> Hi David,
>
> On Fri, Feb 11, 2011 at 09:25:32PM -0800, David Miller wrote:
>> I can't pull from that tree because it is _NOT_ based upon net-next-2.6
>> and therefore brings in all kinds of commits not related to your work.
> Sorry, I'm not used to the customs on netdev. I can rebase, but still I
> wonder about the reason you cannot pull for. The only reason I can
> imagine is that you fear unrelated breakage when taking these patches
> that are already in Linus' tree. But if it's that, wouldn't it be great
> the realize this breakage already now and not only during the next merge
> window?
My trees only merge in Linus's tree when absolutely necessary,
to resolve conflicts or similar.
We don't bring in unrelated changes into my tree, just for the
sake of doing so.
Otherwise Linus gets all of these ugly merge commits when he
pulls from me, which are entirely unnecessary.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove
2011-02-13 21:15 ` David Miller
@ 2011-02-14 8:25 ` Uwe Kleine-König
2011-02-14 19:05 ` David Miller
0 siblings, 1 reply; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-14 8:25 UTC (permalink / raw)
To: David Miller; +Cc: netdev, shawn.guo, kernel
Hi David,
On Sun, Feb 13, 2011 at 01:15:31PM -0800, David Miller wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Date: Sun, 13 Feb 2011 22:07:09 +0100
> > On Fri, Feb 11, 2011 at 09:25:32PM -0800, David Miller wrote:
> >> I can't pull from that tree because it is _NOT_ based upon net-next-2.6
> >> and therefore brings in all kinds of commits not related to your work.
> > Sorry, I'm not used to the customs on netdev. I can rebase, but still I
> > wonder about the reason you cannot pull for. The only reason I can
> > imagine is that you fear unrelated breakage when taking these patches
> > that are already in Linus' tree. But if it's that, wouldn't it be great
> > the realize this breakage already now and not only during the next merge
> > window?
>
> My trees only merge in Linus's tree when absolutely necessary,
> to resolve conflicts or similar.
You don't merge Linus' tree, you merge mine that just happen to be based
on a newer version of Linus' tree. I'm sure Linus won't yell on you for
that. He only objects to merge directly from his tree, because the
result for him is an "empty" merge.
> We don't bring in unrelated changes into my tree, just for the
> sake of doing so.
>
> Otherwise Linus gets all of these ugly merge commits when he
> pulls from me, which are entirely unnecessary.
The result Linus gets if you pull my tree based on
v2.6.38-rc4-106-gd247852 (as it is now) is the same as if it were based
on v2.6.38-rc2-210-gc69b909 (which is the most recent commit net-next
currently bases on): my 14 patches and your merge commit. The reason for
that is that Linus already has the commits between
v2.6.38-rc2-210-gc69b909 and v2.6.38-rc4-106-gd247852. So this is really
only about when these commits enter *your* tree.
There are currently the following commits in Linus' tree that are used
by commits in net-next as parents:
c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470
ff76015f3bdfbc482c723cb4f2559cef84d178ca (*)
c753796769e4fb0cd813b6e5801b3c01f4681d4f
0c21e3aaf6ae85bee804a325aa29c325209180fd (*)
e92427b289d252cfbd4cb5282d92f4ce1a5bb1fb (*)
1bae4ce27c9c90344f23c65ea6966c50ffeae2f5
7cc2edb83447775a34ed3bf9d29d8295a434b523 (*)
8f2771f2b85aea4d0f9a0137ad3b63d1173c0962 (*)
c4c93106741bbf61ecd05a2a835af8e3bf31c1bd (*)
c7c1806098752c1f46943d8db2c69aff07f5d4bc (*)
479600777bb588724d044815415f7d708d06644b (*)
1e6d93e45b231b3ae87c01902ede2315aacfe976 (*)
9b00b4157f7b3265de291ac8979a5f1611ce64ab
c69b90920a36b88ab0d649963d81355d865eeb05 (*)
and you don't want to take d247852 to this list because it's newer than
all these? How did you decide to take the newest in the list above and
why was that OK?
And as a last point let me note, that from Linus' POV the commits marked
with an asterisk above go into net-next by an empty merge.
Can you please reping me if you still consider that I should rebase my
tree for you to be able to merge it?
Best regards and thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove
2011-02-14 8:25 ` Uwe Kleine-König
@ 2011-02-14 19:05 ` David Miller
2011-02-15 8:53 ` Uwe Kleine-König
0 siblings, 1 reply; 25+ messages in thread
From: David Miller @ 2011-02-14 19:05 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, shawn.guo, kernel
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Mon, 14 Feb 2011 09:25:25 +0100
> Hi David,
>
> On Sun, Feb 13, 2011 at 01:15:31PM -0800, David Miller wrote:
>> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>> Date: Sun, 13 Feb 2011 22:07:09 +0100
>> > On Fri, Feb 11, 2011 at 09:25:32PM -0800, David Miller wrote:
>> >> I can't pull from that tree because it is _NOT_ based upon net-next-2.6
>> >> and therefore brings in all kinds of commits not related to your work.
>> > Sorry, I'm not used to the customs on netdev. I can rebase, but still I
>> > wonder about the reason you cannot pull for. The only reason I can
>> > imagine is that you fear unrelated breakage when taking these patches
>> > that are already in Linus' tree. But if it's that, wouldn't it be great
>> > the realize this breakage already now and not only during the next merge
>> > window?
>>
>> My trees only merge in Linus's tree when absolutely necessary,
>> to resolve conflicts or similar.
> You don't merge Linus' tree, you merge mine that just happen to be based
> on a newer version of Linus' tree. I'm sure Linus won't yell on you for
> that. He only objects to merge directly from his tree, because the
> result for him is an "empty" merge.
You don't get it.
These merge commits look ugly and Linus wants them minimized.
Either you follow the rules and my expectations, which is that when you
give me a GIT tree to pull from it's based upon one of my trees, or
I don't pull from you.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove
2011-02-14 19:05 ` David Miller
@ 2011-02-15 8:53 ` Uwe Kleine-König
2011-02-15 18:31 ` David Miller
0 siblings, 1 reply; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-15 8:53 UTC (permalink / raw)
To: David Miller; +Cc: netdev, shawn.guo, kernel
Hi David,
On Mon, Feb 14, 2011 at 11:05:49AM -0800, David Miller wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Date: Mon, 14 Feb 2011 09:25:25 +0100
> > On Sun, Feb 13, 2011 at 01:15:31PM -0800, David Miller wrote:
> >> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >> Date: Sun, 13 Feb 2011 22:07:09 +0100
> >> > On Fri, Feb 11, 2011 at 09:25:32PM -0800, David Miller wrote:
> >> >> I can't pull from that tree because it is _NOT_ based upon net-next-2.6
> >> >> and therefore brings in all kinds of commits not related to your work.
> >> > Sorry, I'm not used to the customs on netdev. I can rebase, but still I
> >> > wonder about the reason you cannot pull for. The only reason I can
> >> > imagine is that you fear unrelated breakage when taking these patches
> >> > that are already in Linus' tree. But if it's that, wouldn't it be great
> >> > the realize this breakage already now and not only during the next merge
> >> > window?
> >>
> >> My trees only merge in Linus's tree when absolutely necessary,
> >> to resolve conflicts or similar.
> > You don't merge Linus' tree, you merge mine that just happen to be based
> > on a newer version of Linus' tree. I'm sure Linus won't yell on you for
> > that. He only objects to merge directly from his tree, because the
> > result for him is an "empty" merge.
>
> You don't get it.
>
> These merge commits look ugly and Linus wants them minimized.
Hmm, right, I don't get why this looks uglier for Linus than a merge of
a tree that bases on something you already have. I guess you're too
annoyed by now to explain why you think it does.
> Either you follow the rules and my expectations, which is that when you
> give me a GIT tree to pull from it's based upon one of my trees, or
> I don't pull from you.
So I rebased my tree on something older. It now starts at
c69b909 (pch_can: fix module reload issue with MSI)
which is already in net-next/master.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove
2011-02-15 8:53 ` Uwe Kleine-König
@ 2011-02-15 18:31 ` David Miller
2011-02-15 20:00 ` Uwe Kleine-König
0 siblings, 1 reply; 25+ messages in thread
From: David Miller @ 2011-02-15 18:31 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, shawn.guo, kernel
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Tue, 15 Feb 2011 09:53:05 +0100
> On Mon, Feb 14, 2011 at 11:05:49AM -0800, David Miller wrote:
>> These merge commits look ugly and Linus wants them minimized.
> Hmm, right, I don't get why this looks uglier for Linus than a merge of
> a tree that bases on something you already have. I guess you're too
> annoyed by now to explain why you think it does.
What's so hard to understand about the fact that when I pull from
someone I do not want any commits unrelated to the work that person
is sending me?
>> Either you follow the rules and my expectations, which is that when you
>> give me a GIT tree to pull from it's based upon one of my trees, or
>> I don't pull from you.
> So I rebased my tree on something older. It now starts at
>
> c69b909 (pch_can: fix module reload issue with MSI)
>
> which is already in net-next/master.
You need to send a new pull request so that it gets properly tracked
in patchwork.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove
2011-02-15 18:31 ` David Miller
@ 2011-02-15 20:00 ` Uwe Kleine-König
0 siblings, 0 replies; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-15 20:00 UTC (permalink / raw)
To: David Miller; +Cc: netdev, shawn.guo, kernel
On Tue, Feb 15, 2011 at 10:31:59AM -0800, David Miller wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Date: Tue, 15 Feb 2011 09:53:05 +0100
>
> > On Mon, Feb 14, 2011 at 11:05:49AM -0800, David Miller wrote:
> >> These merge commits look ugly and Linus wants them minimized.
> > Hmm, right, I don't get why this looks uglier for Linus than a merge of
> > a tree that bases on something you already have. I guess you're too
> > annoyed by now to explain why you think it does.
>
> What's so hard to understand about the fact that when I pull from
> someone I do not want any commits unrelated to the work that person
> is sending me?
Perfectly fine, I can live with this explanation. Next time say that at
once :-)
> >> Either you follow the rules and my expectations, which is that when you
> >> give me a GIT tree to pull from it's based upon one of my trees, or
> >> I don't pull from you.
> > So I rebased my tree on something older. It now starts at
> >
> > c69b909 (pch_can: fix module reload issue with MSI)
> >
> > which is already in net-next/master.
>
> You need to send a new pull request so that it gets properly tracked
> in patchwork.
Oh, I didn't know that patchwork tracks pull requests, too:
The following changes since commit c69b90920a36b88ab0d649963d81355d865eeb05:
pch_can: fix module reload issue with MSI (2011-02-08 16:37:20 -0800)
are available in the git repository at:
git://git.pengutronix.de/git/ukl/linux-2.6.git fec
Uwe Kleine-König (14):
net/fec: no need to cast arguments for memcpy
net/fec: release mem_region requested in probe in error path and remove
net/fec: don't free an irq that failed to be requested
net/fec: no need to check for validity of ndev in suspend and resume
net/fec: no need to memzero private data
net/fec: put the ioremap cookie immediately into a void __iomem pointer
net/fec: consolidate all i.MX options to CONFIG_ARM
net/fec: add phy_stop to fec_enet_close
net/fec: consistenly name struct net_device pointers "ndev"
net/fec: some whitespace cleanup
net/fec: reorder functions a bit allows removing forward declarations
net/fec: provide device for dma functions and matching sizes for map and unmap
net/fec: postpone unsetting driver data until the hardware is stopped
net/fec: enable flow control and length check on enet-mac
drivers/net/Kconfig | 3 +-
drivers/net/fec.c | 650 ++++++++++++++++++++++++++-------------------------
2 files changed, 328 insertions(+), 325 deletions(-)
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 15/14] net/fec: remove unused driver data
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
` (12 preceding siblings ...)
2011-02-11 10:32 ` [PATCH 14/14] net/fec: enable flow control and length check on enet-mac Uwe Kleine-König
@ 2011-02-17 22:32 ` Uwe Kleine-König
2011-02-22 18:16 ` David Miller
13 siblings, 1 reply; 25+ messages in thread
From: Uwe Kleine-König @ 2011-02-17 22:32 UTC (permalink / raw)
To: netdev; +Cc: Marc Kleine-Budde, kernel
Apart from not being used the first argument isn't even a struct
platform_device *.
Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,
this patch is available at
git://git.pengutronix.de/git/ukl/linux-2.6.git fec
based on the patches already merged into net-next.
Use whatever is easier for you.
Best regards
Uwe
drivers/net/fec.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 74798be..634c0da 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -983,8 +983,6 @@ static int fec_enet_mii_init(struct platform_device *pdev)
for (i = 0; i < PHY_MAX_ADDR; i++)
fep->mii_bus->irq[i] = PHY_POLL;
- platform_set_drvdata(ndev, fep->mii_bus);
-
if (mdiobus_register(fep->mii_bus))
goto err_out_free_mdio_irq;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH 15/14] net/fec: remove unused driver data
2011-02-17 22:32 ` [PATCH 15/14] net/fec: remove unused driver data Uwe Kleine-König
@ 2011-02-22 18:16 ` David Miller
0 siblings, 0 replies; 25+ messages in thread
From: David Miller @ 2011-02-22 18:16 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, mkl, kernel
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Thu, 17 Feb 2011 23:32:25 +0100
> Apart from not being used the first argument isn't even a struct
> platform_device *.
>
> Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
>
> this patch is available at
>
> git://git.pengutronix.de/git/ukl/linux-2.6.git fec
>
> based on the patches already merged into net-next.
Pulled, thanks.
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2011-02-22 18:16 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-11 10:32 [PATCH 01/14] net/fec: no need to cast arguments for memcpy Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 02/14] net/fec: release mem_region requested in probe in error path and remove Uwe Kleine-König
2011-02-11 11:03 ` Uwe Kleine-König
2011-02-12 5:25 ` David Miller
2011-02-13 21:07 ` Uwe Kleine-König
2011-02-13 21:15 ` David Miller
2011-02-14 8:25 ` Uwe Kleine-König
2011-02-14 19:05 ` David Miller
2011-02-15 8:53 ` Uwe Kleine-König
2011-02-15 18:31 ` David Miller
2011-02-15 20:00 ` Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 03/14] net/fec: don't free an irq that failed to be requested Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 04/14] net/fec: no need to check for validity of ndev in suspend and resume Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 05/14] net/fec: no need to memzero private data Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 06/14] net/fec: put the ioremap cookie immediately into a void __iomem pointer Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 07/14] net/fec: consolidate all i.MX options to CONFIG_ARM Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 08/14] net/fec: add phy_stop to fec_enet_close Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 09/14] net/fec: consistenly name struct net_device pointers "ndev" Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 10/14] net/fec: some whitespace cleanup Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 11/14] net/fec: reorder functions a bit allows removing forward declarations Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 12/14] net/fec: provide device for dma functions and matching sizes for map and unmap Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 13/14] net/fec: postpone unsetting driver data until the hardware is stopped Uwe Kleine-König
2011-02-11 10:32 ` [PATCH 14/14] net/fec: enable flow control and length check on enet-mac Uwe Kleine-König
2011-02-17 22:32 ` [PATCH 15/14] net/fec: remove unused driver data Uwe Kleine-König
2011-02-22 18:16 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).