[PATCH 1/2] Char: applicom, use pci_resource_start

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: <linux-kernel@...>, <dwmw2@...>, Jiri Slaby <jirislaby@...>
Date: Wednesday, January 30, 2008 - 7:13 am

Use pci_resource_start instead of accessing pci_dev struct internals.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
 drivers/char/applicom.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 1f0b752..b0bb71b 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -206,22 +206,23 @@ static int __init applicom_init(void)
 		if (pci_enable_device(dev))
 			return -EIO;
 
-		RamIO = ioremap(dev->resource[0].start, LEN_RAM_IO);
+		RamIO = ioremap(pci_resource_start(dev, 0), LEN_RAM_IO);
 
 		if (!RamIO) {
 			printk(KERN_INFO "ac.o: Failed to ioremap PCI memory "
 				"space at 0x%llx\n",
-				(unsigned long long)dev->resource[0].start);
+				(unsigned long long)pci_resource_start(dev, 0));
 			pci_disable_device(dev);
 			return -EIO;
 		}
 
 		printk(KERN_INFO "Applicom %s found at mem 0x%llx, irq %d\n",
 		       applicom_pci_devnames[dev->device-1],
-			   (unsigned long long)dev->resource[0].start,
+			   (unsigned long long)pci_resource_start(dev, 0),
 		       dev->irq);
 
-		boardno = ac_register_board(dev->resource[0].start, RamIO,0);
+		boardno = ac_register_board(pci_resource_start(dev, 0),
+				RamIO, 0);
 		if (!boardno) {
 			printk(KERN_INFO "ac.o: PCI Applicom device doesn't have correct signature.\n");
 			iounmap(RamIO);
-- 
1.5.3.8

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[Patch] Shut up warnings from files under drivers/, WANG Cong, (Sat Jan 26, 5:30 am)
Re: [Patch] Shut up warnings from files under drivers/, Sam Ravnborg, (Sat Jan 26, 5:57 am)
Re: [Patch] Shut up warnings from files under drivers/, Sam Ravnborg, (Sat Jan 26, 6:21 am)
Re: [Patch] Shut up warnings from files under drivers/, Jeff Garzik, (Sat Jan 26, 5:55 am)
Re: [Patch] Shut up warnings from files under drivers/, Sam Ravnborg, (Sat Jan 26, 3:17 pm)
[PATCH 2/2] Char: applicom, use pci_match_id, Jiri Slaby, (Wed Jan 30, 7:13 am)
Re: [PATCH 2/2] Char: applicom, use pci_match_id, Andrew Morton, (Wed Jan 30, 7:10 pm)
Re: [PATCH 2/2] Char: applicom, use pci_match_id, Jiri Slaby, (Thu Jan 31, 5:26 am)
[PATCH 1/2] Char: applicom, use pci_resource_start, Jiri Slaby, (Wed Jan 30, 7:13 am)
Re: [Patch] Shut up warnings from files under drivers/, Sam Ravnborg, (Sat Jan 26, 3:30 pm)
Re: [Patch] Shut up warnings from files under drivers/, Jeff Garzik, (Sat Jan 26, 7:44 am)