lkml.org 
[lkml]   [2000]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] drivers/net/starfire.c - ioremap return typr - 2.4.0-test10-pre2
- the cast on the return value of ioremap can be avoided;
- we want to print pci_resource_start(pdev, 0) instead of ioaddr when
ioaddr is NULL (tail of the patch).

diff -u --recursive linux-2.4.0-test10-pre2.orig/drivers/net/starfire.c linux-2.4.0-test10-pre2/drivers/net/starfire.c
--- linux-2.4.0-test10-pre2.orig/drivers/net/starfire.c Thu Aug 24 07:37:48 2000
+++ linux-2.4.0-test10-pre2/drivers/net/starfire.c Fri Oct 13 10:00:38 2000
@@ -389,7 +389,7 @@
struct net_device *dev;
static int card_idx = -1;
static int printed_version = 0;
- long ioaddr;
+ void *ioaddr;
int drv_flags, io_size = netdrv_tbl[chip_idx].io_size;

card_idx++;
@@ -399,8 +399,8 @@
printk(KERN_INFO "%s" KERN_INFO "%s" KERN_INFO "%s",
version1, version2, version3);

- ioaddr = pci_resource_start (pdev, 0);
- if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_MEM) == 0)) {
+ if (!pci_resource_start (pdev, 0) ||
+ ((pci_resource_flags (pdev, 0) & IORESOURCE_MEM) == 0)) {
printk (KERN_ERR "starfire %d: no PCI MEM resources, aborting\n", card_idx);
return -ENODEV;
}
@@ -413,19 +413,19 @@

irq = pdev->irq;

- if (request_mem_region (ioaddr, io_size, dev->name) == NULL) {
+ if (!request_mem_regionx(pci_resource_start(pdev, 0), io_size, dev->name)) {
printk (KERN_ERR "starfire %d: resource 0x%x @ 0x%lx busy, aborting\n",
- card_idx, io_size, ioaddr);
+ card_idx, io_size, pci_resource_start(pdev, 0));
goto err_out_free_netdev;
}

if (pci_enable_device (pdev))
goto err_out_free_res;

- ioaddr = (long) ioremap (ioaddr, io_size);
+ ioaddr = ioremap(pci_resource_start(pdev, 0), io_size);
if (!ioaddr) {
printk (KERN_ERR "starfire %d: cannot remap 0x%x @ 0x%lx, aborting\n",
- card_idx, io_size, ioaddr);
+ card_idx, io_size, pci_resource_start(pdev, 0));
goto err_out_free_res;
}

--
Ueimor
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.023 / U:3.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site