static int elp_autodetect(struct device * dev) { int idx=0, addr; /* if base address set, then only check that address otherwise, run through the table */ if ( (addr=dev->base_addr) ) { /* dev->base_addr == 0 ==> plain autodetect */ if (elp_debug > 0) printk(search_msg, dev->name, addr); if (elp_sense(addr) == 0) { if (elp_debug > 0) printk(found_msg); return addr; } else if (elp_debug > 0) printk(notfound_msg); } else while ( (addr=addr_list[idx++]) ) { if (elp_debug > 0) printk(search_msg, dev->name, addr); if (elp_sense(addr) == 0) { if (elp_debug > 0) printk(found_msg); return addr; } else if (elp_debug > 0) printk(notfound_msg); } /* could not find an adapter */ if (elp_debug == 0) printk(couldnot_msg, dev->name); return 0; /* Because of this, the layer above will return -ENODEV */ }
static int __init elp_autodetect(struct net_device *dev) { int idx = 0; if (dev->base_addr != 0) { if (elp_sense(dev) == 0) return dev->base_addr; } else while ((dev->base_addr = addr_list[idx++])) { if (elp_sense(dev) == 0) return dev->base_addr; } if (elp_debug > 0) pr_debug(couldnot_msg, dev->name); return 0; }
static int __init elp_autodetect(struct net_device *dev) { int idx = 0; /* if base address set, then only check that address otherwise, run through the table */ if (dev->base_addr != 0) { /* dev->base_addr == 0 ==> plain autodetect */ if (elp_sense(dev) == 0) return dev->base_addr; } else while ((dev->base_addr = addr_list[idx++])) { if (elp_sense(dev) == 0) return dev->base_addr; } /* could not find an adapter */ if (elp_debug > 0) printk(couldnot_msg, dev->name); return 0; /* Because of this, the layer above will return -ENODEV */ }