Skip to content

Commit

Permalink
tokenring: convert drivers to net_device_ops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Mar 27, 2009
1 parent ddec2c8 commit 79f8ae3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
11 changes: 6 additions & 5 deletions drivers/net/tokenring/madgemc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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) {
Expand Down Expand Up @@ -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);

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

Expand Down
9 changes: 7 additions & 2 deletions drivers/net/tokenring/proteon.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ static int __init proteon_probe1(struct net_device *dev, int ioaddr)
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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 7 additions & 2 deletions drivers/net/tokenring/skisa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 79f8ae3

Please sign in to comment.