git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netdev: convert cs89x0 to net_device_ops
[safe/jmp/linux-2.6]
/
drivers
/
net
/
smc911x.c
diff --git
a/drivers/net/smc911x.c
b/drivers/net/smc911x.c
index
b185cd1
..
2936103
100644
(file)
--- a/
drivers/net/smc911x.c
+++ b/
drivers/net/smc911x.c
@@
-220,9
+220,9
@@
static void smc911x_reset(struct net_device *dev)
/* make sure EEPROM has finished loading before setting GPIO_CFG */
timeout=1000;
/* make sure EEPROM has finished loading before setting GPIO_CFG */
timeout=1000;
- while (
timeout-- && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) {
+ while (
--timeout && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_))
udelay(10);
udelay(10);
- }
+
if (timeout == 0){
PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name);
return;
if (timeout == 0){
PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name);
return;
@@
-439,7
+439,6
@@
static inline void smc911x_rcv(struct net_device *dev)
DBG(SMC_DEBUG_PKTS, "%s: Received packet\n", dev->name);
PRINT_PKT(data, ((pkt_len - 4) <= 64) ? pkt_len - 4 : 64);
DBG(SMC_DEBUG_PKTS, "%s: Received packet\n", dev->name);
PRINT_PKT(data, ((pkt_len - 4) <= 64) ? pkt_len - 4 : 64);
- dev->last_rx = jiffies;
skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb);
dev->stats.rx_packets++;
skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb);
dev->stats.rx_packets++;
@@
-1231,7
+1230,6
@@
smc911x_rx_dma_irq(int dma, void *data)
BUG_ON(skb == NULL);
lp->current_rx_skb = NULL;
PRINT_PKT(skb->data, skb->len);
BUG_ON(skb == NULL);
lp->current_rx_skb = NULL;
PRINT_PKT(skb->data, skb->len);
- dev->last_rx = jiffies;
skb->protocol = eth_type_trans(skb, dev);
dev->stats.rx_packets++;
dev->stats.rx_bytes += skb->len;
skb->protocol = eth_type_trans(skb, dev);
dev->stats.rx_packets++;
dev->stats.rx_bytes += skb->len;
@@
-1547,7
+1545,7
@@
smc911x_ethtool_getdrvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{
strncpy(info->driver, CARDNAME, sizeof(info->driver));
strncpy(info->version, version, sizeof(info->version));
{
strncpy(info->driver, CARDNAME, sizeof(info->driver));
strncpy(info->version, version, sizeof(info->version));
- strncpy(info->bus_info, dev
->dev.parent->bus_id
, sizeof(info->bus_info));
+ strncpy(info->bus_info, dev
_name(dev->dev.parent)
, sizeof(info->bus_info));
}
static int smc911x_ethtool_nwayreset(struct net_device *dev)
}
static int smc911x_ethtool_nwayreset(struct net_device *dev)
@@
-1735,7
+1733,7
@@
static const struct ethtool_ops smc911x_ethtool_ops = {
* This routine has a simple purpose -- make the SMC chip generate an
* interrupt, so an auto-detect routine can detect it, and find the IRQ,
*/
* This routine has a simple purpose -- make the SMC chip generate an
* interrupt, so an auto-detect routine can detect it, and find the IRQ,
*/
-static int __init smc911x_findirq(struct net_device *dev)
+static int __
dev
init smc911x_findirq(struct net_device *dev)
{
struct smc911x_local *lp = netdev_priv(dev);
int timeout = 20;
{
struct smc911x_local *lp = netdev_priv(dev);
int timeout = 20;
@@
-1799,7
+1797,7
@@
static int __init smc911x_findirq(struct net_device *dev)
* o actually GRAB the irq.
* o GRAB the region
*/
* o actually GRAB the irq.
* o GRAB the region
*/
-static int __init smc911x_probe(struct net_device *dev)
+static int __
dev
init smc911x_probe(struct net_device *dev)
{
struct smc911x_local *lp = netdev_priv(dev);
int i, retval;
{
struct smc911x_local *lp = netdev_priv(dev);
int i, retval;
@@
-2048,11
+2046,8
@@
err_out:
* 0 --> there is a device
* anything else, error
*/
* 0 --> there is a device
* anything else, error
*/
-static int smc911x_drv_probe(struct platform_device *pdev)
+static int
__devinit
smc911x_drv_probe(struct platform_device *pdev)
{
{
-#ifdef SMC_DYNAMIC_BUS_CONFIG
- struct smc911x_platdata *pd = pdev->dev.platform_data;
-#endif
struct net_device *ndev;
struct resource *res;
struct smc911x_local *lp;
struct net_device *ndev;
struct resource *res;
struct smc911x_local *lp;
@@
-2087,11
+2082,14
@@
static int smc911x_drv_probe(struct platform_device *pdev)
lp = netdev_priv(ndev);
lp->netdev = ndev;
#ifdef SMC_DYNAMIC_BUS_CONFIG
lp = netdev_priv(ndev);
lp->netdev = ndev;
#ifdef SMC_DYNAMIC_BUS_CONFIG
- if (!pd) {
- ret = -EINVAL;
- goto release_both;
+ {
+ struct smc911x_platdata *pd = pdev->dev.platform_data;
+ if (!pd) {
+ ret = -EINVAL;
+ goto release_both;
+ }
+ memcpy(&lp->cfg, pd, sizeof(lp->cfg));
}
}
- memcpy(&lp->cfg, pd, sizeof(lp->cfg));
#endif
addr = ioremap(res->start, SMC911X_IO_EXTENT);
#endif
addr = ioremap(res->start, SMC911X_IO_EXTENT);
@@
-2124,7
+2122,7
@@
out:
return ret;
}
return ret;
}
-static int smc911x_drv_remove(struct platform_device *pdev)
+static int
__devexit
smc911x_drv_remove(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct smc911x_local *lp = netdev_priv(ndev);
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct smc911x_local *lp = netdev_priv(ndev);
@@
-2195,7
+2193,7
@@
static int smc911x_drv_resume(struct platform_device *dev)
static struct platform_driver smc911x_driver = {
.probe = smc911x_drv_probe,
static struct platform_driver smc911x_driver = {
.probe = smc911x_drv_probe,
- .remove =
smc911x_drv_remove
,
+ .remove =
__devexit_p(smc911x_drv_remove)
,
.suspend = smc911x_drv_suspend,
.resume = smc911x_drv_resume,
.driver = {
.suspend = smc911x_drv_suspend,
.resume = smc911x_drv_resume,
.driver = {