From: Henrik Kretzschmar <[email protected]>
Some little cleanups for ULI-TULIP-driver:
pci_module_init() conversion to pci_register_driver()
remove rc, an unneeded variable from uli526x_module_init()
let the debug macros use correct loglevels
add a loglevel to a printk
let some code more look like CodingStyle
Signed-off-by: Henrik Kretzschmar <[email protected]>
---
--- linux-2.6.18-rc2/drivers/net/tulip/uli526x.c 2006-07-18 13:37:09.000000000 +0200
+++ linux/drivers/net/tulip/uli526x.c 2006-07-20 11:43:07.000000000 +0200
@@ -82,9 +82,9 @@
#define ULI526X_TX_TIMEOUT ((16*HZ)/2) /* tx packet time-out time 8 s" */
#define ULI526X_TX_KICK (4*HZ/2) /* tx packet Kick-out time 2 s" */
-#define ULI526X_DBUG(dbug_now, msg, value) if (uli526x_debug || (dbug_now)) printk(KERN_ERR DRV_NAME ": %s %lx\n", (msg), (long) (value))
+#define ULI526X_DBUG(dbug_now, msg, value) if (uli526x_debug || (dbug_now)) printk(KERN_DEBUG DRV_NAME ": %s %lx\n", (msg), (long) (value))
-#define SHOW_MEDIA_TYPE(mode) printk(KERN_ERR DRV_NAME ": Change Speed to %sMhz %s duplex\n",mode & 1 ?"100":"10", mode & 4 ? "full":"half");
+#define SHOW_MEDIA_TYPE(mode) printk(KERN_NOTICE DRV_NAME ": Change Speed to %sMhz %s duplex\n",mode & 1 ?"100":"10", mode & 4 ? "full":"half");
/* CR9 definition: SROM/MII */
@@ -373,7 +373,8 @@
if (err)
goto err_out_res;
- printk(KERN_INFO "%s: ULi M%04lx at pci%s,",dev->name,ent->driver_data >> 16,pci_name(pdev));
+ printk(KERN_INFO "%s: ULi M%04lx at pci%s,",dev->name,
+ ent->driver_data >> 16,pci_name(pdev));
for (i = 0; i < 6; i++)
printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]);
@@ -1027,7 +1028,7 @@
if ( time_after(jiffies, dev->trans_start + ULI526X_TX_TIMEOUT) ) {
db->reset_TXtimeout++;
db->wait_reset = 1;
- printk( "%s: Tx timeout - resetting\n",
+ printk(KERN_ERR "%s: Tx timeout - resetting\n",
dev->name);
}
}
@@ -1671,18 +1672,17 @@
static struct pci_device_id uli526x_pci_tbl[] = {
- { 0x10B9, 0x5261, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_ULI5261_ID },
- { 0x10B9, 0x5263, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_ULI5263_ID },
- { 0, }
+ {0x10B9, 0x5261, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_ULI5261_ID},
+ {0x10B9, 0x5263, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_ULI5263_ID},
+ {}
};
MODULE_DEVICE_TABLE(pci, uli526x_pci_tbl);
-
static struct pci_driver uli526x_driver = {
- .name = "uli526x",
- .id_table = uli526x_pci_tbl,
- .probe = uli526x_init_one,
- .remove = __devexit_p(uli526x_remove_one),
+ .name = "uli526x",
+ .id_table = uli526x_pci_tbl,
+ .probe = uli526x_init_one,
+ .remove = __devexit_p(uli526x_remove_one),
};
MODULE_AUTHOR("Peer Chen, [email protected]");
@@ -1702,7 +1702,6 @@
static int __init uli526x_init_module(void)
{
- int rc;
printk(version);
printed_version = 1;
@@ -1714,25 +1713,21 @@
if (cr6set)
uli526x_cr6_user_set = cr6set;
- switch(mode) {
+ switch (mode) {
case ULI526X_10MHF:
case ULI526X_100MHF:
case ULI526X_10MFD:
case ULI526X_100MFD:
uli526x_media_mode = mode;
break;
- default:uli526x_media_mode = ULI526X_AUTO;
+ default:
+ uli526x_media_mode = ULI526X_AUTO;
break;
}
- rc = pci_module_init(&uli526x_driver);
- if (rc < 0)
- return rc;
-
- return 0;
+ return pci_register_driver(&uli526x_driver);
}
-
/*
* Description:
* when user used rmmod to delete module, system invoked clean_module()
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]