diff options
Diffstat (limited to 'drivers/net/ne2k-pci.c')
-rw-r--r-- | drivers/net/ne2k-pci.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c index ced9fdb8335..589785d1e76 100644 --- a/drivers/net/ne2k-pci.c +++ b/drivers/net/ne2k-pci.c | |||
@@ -175,9 +175,9 @@ static void ne2k_pci_block_input(struct net_device *dev, int count, | |||
175 | struct sk_buff *skb, int ring_offset); | 175 | struct sk_buff *skb, int ring_offset); |
176 | static void ne2k_pci_block_output(struct net_device *dev, const int count, | 176 | static void ne2k_pci_block_output(struct net_device *dev, const int count, |
177 | const unsigned char *buf, const int start_page); | 177 | const unsigned char *buf, const int start_page); |
178 | static struct ethtool_ops ne2k_pci_ethtool_ops; | 178 | static const struct ethtool_ops ne2k_pci_ethtool_ops; |
179 | |||
179 | 180 | ||
180 | |||
181 | 181 | ||
182 | /* There is no room in the standard 8390 structure for extra info we need, | 182 | /* There is no room in the standard 8390 structure for extra info we need, |
183 | so we build a meta/outer-wrapper structure.. */ | 183 | so we build a meta/outer-wrapper structure.. */ |
@@ -231,12 +231,12 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, | |||
231 | irq = pdev->irq; | 231 | irq = pdev->irq; |
232 | 232 | ||
233 | if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) { | 233 | if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) { |
234 | printk (KERN_ERR PFX "no I/O resource at PCI BAR #0\n"); | 234 | dev_err(&pdev->dev, "no I/O resource at PCI BAR #0\n"); |
235 | return -ENODEV; | 235 | return -ENODEV; |
236 | } | 236 | } |
237 | 237 | ||
238 | if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) { | 238 | if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) { |
239 | printk (KERN_ERR PFX "I/O resource 0x%x @ 0x%lx busy\n", | 239 | dev_err(&pdev->dev, "I/O resource 0x%x @ 0x%lx busy\n", |
240 | NE_IO_EXTENT, ioaddr); | 240 | NE_IO_EXTENT, ioaddr); |
241 | return -EBUSY; | 241 | return -EBUSY; |
242 | } | 242 | } |
@@ -263,7 +263,7 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, | |||
263 | /* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */ | 263 | /* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */ |
264 | dev = alloc_ei_netdev(); | 264 | dev = alloc_ei_netdev(); |
265 | if (!dev) { | 265 | if (!dev) { |
266 | printk (KERN_ERR PFX "cannot allocate ethernet device\n"); | 266 | dev_err(&pdev->dev, "cannot allocate ethernet device\n"); |
267 | goto err_out_free_res; | 267 | goto err_out_free_res; |
268 | } | 268 | } |
269 | SET_MODULE_OWNER(dev); | 269 | SET_MODULE_OWNER(dev); |
@@ -281,7 +281,8 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, | |||
281 | while ((inb(ioaddr + EN0_ISR) & ENISR_RESET) == 0) | 281 | while ((inb(ioaddr + EN0_ISR) & ENISR_RESET) == 0) |
282 | /* Limit wait: '2' avoids jiffy roll-over. */ | 282 | /* Limit wait: '2' avoids jiffy roll-over. */ |
283 | if (jiffies - reset_start_time > 2) { | 283 | if (jiffies - reset_start_time > 2) { |
284 | printk(KERN_ERR PFX "Card failure (no reset ack).\n"); | 284 | dev_err(&pdev->dev, |
285 | "Card failure (no reset ack).\n"); | ||
285 | goto err_out_free_netdev; | 286 | goto err_out_free_netdev; |
286 | } | 287 | } |
287 | 288 | ||
@@ -385,7 +386,7 @@ err_out_free_res: | |||
385 | 386 | ||
386 | } | 387 | } |
387 | 388 | ||
388 | /* | 389 | /* |
389 | * Magic incantation sequence for full duplex on the supported cards. | 390 | * Magic incantation sequence for full duplex on the supported cards. |
390 | */ | 391 | */ |
391 | static inline int set_realtek_fdx(struct net_device *dev) | 392 | static inline int set_realtek_fdx(struct net_device *dev) |
@@ -410,7 +411,7 @@ static inline int set_holtek_fdx(struct net_device *dev) | |||
410 | 411 | ||
411 | static int ne2k_pci_set_fdx(struct net_device *dev) | 412 | static int ne2k_pci_set_fdx(struct net_device *dev) |
412 | { | 413 | { |
413 | if (ei_status.ne2k_flags & REALTEK_FDX) | 414 | if (ei_status.ne2k_flags & REALTEK_FDX) |
414 | return set_realtek_fdx(dev); | 415 | return set_realtek_fdx(dev); |
415 | else if (ei_status.ne2k_flags & HOLTEK_FDX) | 416 | else if (ei_status.ne2k_flags & HOLTEK_FDX) |
416 | return set_holtek_fdx(dev); | 417 | return set_holtek_fdx(dev); |
@@ -420,7 +421,7 @@ static int ne2k_pci_set_fdx(struct net_device *dev) | |||
420 | 421 | ||
421 | static int ne2k_pci_open(struct net_device *dev) | 422 | static int ne2k_pci_open(struct net_device *dev) |
422 | { | 423 | { |
423 | int ret = request_irq(dev->irq, ei_interrupt, SA_SHIRQ, dev->name, dev); | 424 | int ret = request_irq(dev->irq, ei_interrupt, IRQF_SHARED, dev->name, dev); |
424 | if (ret) | 425 | if (ret) |
425 | return ret; | 426 | return ret; |
426 | 427 | ||
@@ -634,7 +635,7 @@ static void ne2k_pci_get_drvinfo(struct net_device *dev, | |||
634 | strcpy(info->bus_info, pci_name(pci_dev)); | 635 | strcpy(info->bus_info, pci_name(pci_dev)); |
635 | } | 636 | } |
636 | 637 | ||
637 | static struct ethtool_ops ne2k_pci_ethtool_ops = { | 638 | static const struct ethtool_ops ne2k_pci_ethtool_ops = { |
638 | .get_drvinfo = ne2k_pci_get_drvinfo, | 639 | .get_drvinfo = ne2k_pci_get_drvinfo, |
639 | .get_tx_csum = ethtool_op_get_tx_csum, | 640 | .get_tx_csum = ethtool_op_get_tx_csum, |
640 | .get_sg = ethtool_op_get_sg, | 641 | .get_sg = ethtool_op_get_sg, |
@@ -701,7 +702,7 @@ static int __init ne2k_pci_init(void) | |||
701 | #ifdef MODULE | 702 | #ifdef MODULE |
702 | printk(version); | 703 | printk(version); |
703 | #endif | 704 | #endif |
704 | return pci_module_init (&ne2k_driver); | 705 | return pci_register_driver(&ne2k_driver); |
705 | } | 706 | } |
706 | 707 | ||
707 | 708 | ||