From 79f8ae3aa27f2f17a50ad1deee1e16ff02be01bb Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 26 Mar 2009 15:11:23 +0000 Subject: tokenring: convert drivers to net_device_ops Convert madge and proteon drivers which are really just subclasses of tms380. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- drivers/net/tokenring/madgemc.c | 11 ++++++----- drivers/net/tokenring/proteon.c | 9 +++++++-- drivers/net/tokenring/skisa.c | 9 +++++++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c index 193308118f9..456f8bff40b 100644 --- a/drivers/net/tokenring/madgemc.c +++ b/drivers/net/tokenring/madgemc.c @@ -142,7 +142,7 @@ static void madgemc_sifwritew(struct net_device *dev, unsigned short val, unsign return; } - +static struct net_device_ops madgemc_netdev_ops __read_mostly; static int __devinit madgemc_probe(struct device *device) { @@ -168,7 +168,7 @@ static int __devinit madgemc_probe(struct device *device) goto getout; } - dev->dma = 0; + dev->netdev_ops = &madgemc_netdev_ops; card = kmalloc(sizeof(struct card_info), GFP_KERNEL); if (card==NULL) { @@ -348,9 +348,6 @@ static int __devinit madgemc_probe(struct device *device) memcpy(tp->ProductID, "Madge MCA 16/4 ", PROD_ID_SIZE + 1); - dev->open = madgemc_open; - dev->stop = madgemc_close; - tp->tmspriv = card; dev_set_drvdata(device, dev); @@ -758,6 +755,10 @@ static struct mca_driver madgemc_driver = { static int __init madgemc_init (void) { + madgemc_netdev_ops = tms380tr_netdev_ops; + madgemc_netdev_ops.ndo_open = madgemc_open; + madgemc_netdev_ops.ndo_stop = madgemc_close; + return mca_register_driver (&madgemc_driver); } diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c index b8c955f6d31..16e8783ee9c 100644 --- a/drivers/net/tokenring/proteon.c +++ b/drivers/net/tokenring/proteon.c @@ -116,6 +116,8 @@ nodev: return -ENODEV; } +static struct net_device_ops proteon_netdev_ops __read_mostly; + static int __init setup_card(struct net_device *dev, struct device *pdev) { struct net_local *tp; @@ -167,8 +169,7 @@ static int __init setup_card(struct net_device *dev, struct device *pdev) tp->tmspriv = NULL; - dev->open = proteon_open; - dev->stop = tms380tr_close; + dev->netdev_ops = &proteon_netdev_ops; if (dev->irq == 0) { @@ -352,6 +353,10 @@ static int __init proteon_init(void) struct platform_device *pdev; int i, num = 0, err = 0; + proteon_netdev_ops = tms380tr_netdev_ops; + proteon_netdev_ops.ndo_open = proteon_open; + proteon_netdev_ops.ndo_stop = tms380tr_close; + err = platform_driver_register(&proteon_driver); if (err) return err; diff --git a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c index c0f58f08782..46db5c5395b 100644 --- a/drivers/net/tokenring/skisa.c +++ b/drivers/net/tokenring/skisa.c @@ -133,6 +133,8 @@ static int __init sk_isa_probe1(struct net_device *dev, int ioaddr) return 0; } +static struct net_device_ops sk_isa_netdev_ops __read_mostly; + static int __init setup_card(struct net_device *dev, struct device *pdev) { struct net_local *tp; @@ -184,8 +186,7 @@ static int __init setup_card(struct net_device *dev, struct device *pdev) tp->tmspriv = NULL; - dev->open = sk_isa_open; - dev->stop = tms380tr_close; + dev->netdev_ops = &sk_isa_netdev_ops; if (dev->irq == 0) { @@ -362,6 +363,10 @@ static int __init sk_isa_init(void) struct platform_device *pdev; int i, num = 0, err = 0; + sk_isa_netdev_ops = tms380tr_netdev_ops; + sk_isa_netdev_ops.ndo_open = sk_isa_open; + sk_isa_netdev_ops.ndo_stop = tms380tr_close; + err = platform_driver_register(&sk_isa_driver); if (err) return err; -- cgit v1.2.3