tokenring: convert drivers to net_device_ops

Convert madge and proteon drivers which are really just subclasses
of tms380.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Stephen Hemminger 2009-03-26 15:11:23 +00:00 committed by David S. Miller
parent ddec2c89f8
commit 79f8ae3aa2
3 changed files with 20 additions and 9 deletions

View file

@ -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);
}

View file

@ -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;

View file

@ -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;