Commit 46009c8b authored by Jeff Garzik's avatar Jeff Garzik

[netdrvr] minor cleanups in Becker-derived drivers

- fealnx: convert #define to enum
- fealnx, sundance: mark chip info table __devinitdata
- fealnx: use dev_printk() during probe
- fealnx: formatting cleanups
- starfire: remove obsolete comment
- sundance, via-rhine: add some whitespace where useful, in tables
- sundance: prefer "{ }" table terminator
- via-rhine: mark PCI probe table const
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 8ab6f3f7
...@@ -124,7 +124,9 @@ MODULE_PARM_DESC(multicast_filter_limit, "fealnx maximum number of filtered mult ...@@ -124,7 +124,9 @@ MODULE_PARM_DESC(multicast_filter_limit, "fealnx maximum number of filtered mult
MODULE_PARM_DESC(options, "fealnx: Bits 0-3: media type, bit 17: full duplex"); MODULE_PARM_DESC(options, "fealnx: Bits 0-3: media type, bit 17: full duplex");
MODULE_PARM_DESC(full_duplex, "fealnx full duplex setting(s) (1)"); MODULE_PARM_DESC(full_duplex, "fealnx full duplex setting(s) (1)");
#define MIN_REGION_SIZE 136 enum {
MIN_REGION_SIZE = 136,
};
/* A chip capabilities table, matching the entries in pci_tbl[] above. */ /* A chip capabilities table, matching the entries in pci_tbl[] above. */
enum chip_capability_flags { enum chip_capability_flags {
...@@ -149,7 +151,7 @@ struct chip_info { ...@@ -149,7 +151,7 @@ struct chip_info {
int flags; int flags;
}; };
static const struct chip_info skel_netdrv_tbl[] = { static const struct chip_info skel_netdrv_tbl[] __devinitdata = {
{ "100/10M Ethernet PCI Adapter", HAS_MII_XCVR }, { "100/10M Ethernet PCI Adapter", HAS_MII_XCVR },
{ "100/10M Ethernet PCI Adapter", HAS_CHIP_XCVR }, { "100/10M Ethernet PCI Adapter", HAS_CHIP_XCVR },
{ "1000/100/10M Ethernet PCI Adapter", HAS_MII_XCVR }, { "1000/100/10M Ethernet PCI Adapter", HAS_MII_XCVR },
...@@ -503,13 +505,14 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev, ...@@ -503,13 +505,14 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
len = pci_resource_len(pdev, bar); len = pci_resource_len(pdev, bar);
if (len < MIN_REGION_SIZE) { if (len < MIN_REGION_SIZE) {
printk(KERN_ERR "%s: region size %ld too small, aborting\n", dev_printk(KERN_ERR, &pdev->dev,
boardname, len); "region size %ld too small, aborting\n", len);
return -ENODEV; return -ENODEV;
} }
i = pci_request_regions(pdev, boardname); i = pci_request_regions(pdev, boardname);
if (i) return i; if (i)
return i;
irq = pdev->irq; irq = pdev->irq;
......
...@@ -730,7 +730,6 @@ static int __devinit starfire_init_one(struct pci_dev *pdev, ...@@ -730,7 +730,6 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
goto err_out_free_netdev; goto err_out_free_netdev;
} }
/* ioremap is borken in Linux-2.2.x/sparc64 */
base = ioremap(ioaddr, io_size); base = ioremap(ioaddr, io_size);
if (!base) { if (!base) {
printk(KERN_ERR DRV_NAME " %d: cannot remap %#x @ %#lx, aborting\n", printk(KERN_ERR DRV_NAME " %d: cannot remap %#x @ %#lx, aborting\n",
......
...@@ -204,15 +204,15 @@ IVc. Errata ...@@ -204,15 +204,15 @@ IVc. Errata
#define USE_IO_OPS 1 #define USE_IO_OPS 1
#endif #endif
static struct pci_device_id sundance_pci_tbl[] = { static const struct pci_device_id sundance_pci_tbl[] = {
{0x1186, 0x1002, 0x1186, 0x1002, 0, 0, 0}, { 0x1186, 0x1002, 0x1186, 0x1002, 0, 0, 0 },
{0x1186, 0x1002, 0x1186, 0x1003, 0, 0, 1}, { 0x1186, 0x1002, 0x1186, 0x1003, 0, 0, 1 },
{0x1186, 0x1002, 0x1186, 0x1012, 0, 0, 2}, { 0x1186, 0x1002, 0x1186, 0x1012, 0, 0, 2 },
{0x1186, 0x1002, 0x1186, 0x1040, 0, 0, 3}, { 0x1186, 0x1002, 0x1186, 0x1040, 0, 0, 3 },
{0x1186, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, { 0x1186, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
{0x13F0, 0x0201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5}, { 0x13F0, 0x0201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5 },
{0x13F0, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6}, { 0x13F0, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6 },
{0,} { }
}; };
MODULE_DEVICE_TABLE(pci, sundance_pci_tbl); MODULE_DEVICE_TABLE(pci, sundance_pci_tbl);
...@@ -223,7 +223,7 @@ enum { ...@@ -223,7 +223,7 @@ enum {
struct pci_id_info { struct pci_id_info {
const char *name; const char *name;
}; };
static const struct pci_id_info pci_id_tbl[] = { static const struct pci_id_info pci_id_tbl[] __devinitdata = {
{"D-Link DFE-550TX FAST Ethernet Adapter"}, {"D-Link DFE-550TX FAST Ethernet Adapter"},
{"D-Link DFE-550FX 100Mbps Fiber-optics Adapter"}, {"D-Link DFE-550FX 100Mbps Fiber-optics Adapter"},
{"D-Link DFE-580TX 4 port Server Adapter"}, {"D-Link DFE-580TX 4 port Server Adapter"},
...@@ -231,7 +231,7 @@ static const struct pci_id_info pci_id_tbl[] = { ...@@ -231,7 +231,7 @@ static const struct pci_id_info pci_id_tbl[] = {
{"D-Link DL10050-based FAST Ethernet Adapter"}, {"D-Link DL10050-based FAST Ethernet Adapter"},
{"Sundance Technology Alta"}, {"Sundance Technology Alta"},
{"IC Plus Corporation IP100A FAST Ethernet Adapter"}, {"IC Plus Corporation IP100A FAST Ethernet Adapter"},
{NULL,}, /* 0 terminated list. */ { } /* terminate list. */
}; };
/* This driver was written to use PCI memory space, however x86-oriented /* This driver was written to use PCI memory space, however x86-oriented
......
...@@ -252,12 +252,11 @@ enum rhine_quirks { ...@@ -252,12 +252,11 @@ enum rhine_quirks {
/* Beware of PCI posted writes */ /* Beware of PCI posted writes */
#define IOSYNC do { ioread8(ioaddr + StationAddr); } while (0) #define IOSYNC do { ioread8(ioaddr + StationAddr); } while (0)
static struct pci_device_id rhine_pci_tbl[] = static const struct pci_device_id rhine_pci_tbl[] = {
{ { 0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, }, /* VT86C100A */
{0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT86C100A */ { 0x1106, 0x3065, PCI_ANY_ID, PCI_ANY_ID, }, /* VT6102 */
{0x1106, 0x3065, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT6102 */ { 0x1106, 0x3106, PCI_ANY_ID, PCI_ANY_ID, }, /* 6105{,L,LOM} */
{0x1106, 0x3106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* 6105{,L,LOM} */ { 0x1106, 0x3053, PCI_ANY_ID, PCI_ANY_ID, }, /* VT6105M */
{0x1106, 0x3053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT6105M */
{ } /* terminate list */ { } /* terminate list */
}; };
MODULE_DEVICE_TABLE(pci, rhine_pci_tbl); MODULE_DEVICE_TABLE(pci, rhine_pci_tbl);
......
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