Commit d081993a authored by Stephen Hemminger's avatar Stephen Hemminger

[PATCH] arlan new probe code needs to register

Fix arlan registration in the net-drivers-2.5-exp repo.
Need to call register_netdev. Found by viro.
parent f39de482
...@@ -1038,9 +1038,10 @@ static int arlan_mac_addr(struct net_device *dev, void *p) ...@@ -1038,9 +1038,10 @@ static int arlan_mac_addr(struct net_device *dev, void *p)
static void __init arlan_setup_device(struct net_device *dev, int num) static int __init arlan_setup_device(struct net_device *dev, int num)
{ {
struct arlan_private *ap = dev->priv; struct arlan_private *ap = dev->priv;
int err;
ARLAN_DEBUG_ENTRY("arlan_setup_device"); ARLAN_DEBUG_ENTRY("arlan_setup_device");
...@@ -1058,14 +1059,23 @@ static void __init arlan_setup_device(struct net_device *dev, int num) ...@@ -1058,14 +1059,23 @@ static void __init arlan_setup_device(struct net_device *dev, int num)
dev->watchdog_timeo = 3*HZ; dev->watchdog_timeo = 3*HZ;
ap->irq_test_done = 0; ap->irq_test_done = 0;
arlan_device[num] = dev;
ap->Conf = &arlan_conf[num]; ap->Conf = &arlan_conf[num];
ap->Conf->pre_Command_Wait = 40; ap->Conf->pre_Command_Wait = 40;
ap->Conf->rx_tweak1 = 30; ap->Conf->rx_tweak1 = 30;
ap->Conf->rx_tweak2 = 0; ap->Conf->rx_tweak2 = 0;
err = register_netdev(dev);
if (err) {
release_mem_region(virt_to_phys((void *) dev->mem_start),
ARLAN_SHMEM_SIZE);
free_netdev(dev);
return err;
}
arlan_device[num] = dev;
ARLAN_DEBUG_EXIT("arlan_setup_device"); ARLAN_DEBUG_EXIT("arlan_setup_device");
return 0;
} }
static int __init arlan_probe_here(struct net_device *dev, static int __init arlan_probe_here(struct net_device *dev,
...@@ -1772,6 +1782,7 @@ static void arlan_set_multicast(struct net_device *dev) ...@@ -1772,6 +1782,7 @@ static void arlan_set_multicast(struct net_device *dev)
struct net_device * __init arlan_probe(int unit) struct net_device * __init arlan_probe(int unit)
{ {
struct net_device *dev; struct net_device *dev;
int err;
int m; int m;
ARLAN_DEBUG_ENTRY("arlan_probe"); ARLAN_DEBUG_ENTRY("arlan_probe");
...@@ -1822,10 +1833,11 @@ struct net_device * __init arlan_probe(int unit) ...@@ -1822,10 +1833,11 @@ struct net_device * __init arlan_probe(int unit)
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
found: found:
arlan_setup_device(dev, arlans_found++); err = arlan_setup_device(dev, arlans_found);
if (arlans_found == 1) { if (err)
dev = ERR_PTR(err);
else if (!arlans_found++)
printk(KERN_INFO "Arlan driver %s\n", arlan_version); printk(KERN_INFO "Arlan driver %s\n", arlan_version);
}
return dev; return dev;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment