[i2c] [PATCH] pci: use pci_ioremap_bar() in drivers/i2c

Arjan van de Ven arjan at infradead.org
Tue Oct 21 06:57:51 CEST 2008

From 2642176b21b402e7f1ea7697ad2659d0e7e59f6e Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan at linux.intel.com>
Date: Sun, 28 Sep 2008 16:13:48 -0700
Subject: [PATCH] pci: use pci_ioremap_bar() in drivers/i2c

Use the newly introduced pci_ioremap_bar() function in drivers/i2c.
pci_ioremap_bar() just takes a pci device and a bar number, with the goal
of making it really hard to get wrong, while also having a central place
to stick sanity checks.

CC: khali at linux-fr.org
Signed-off-by: Arjan van de Ven <arjan at linux.intel.com>
 drivers/i2c/busses/i2c-hydra.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-hydra.c b/drivers/i2c/busses/i2c-hydra.c
index 1098f21..648aa7b 100644
--- a/drivers/i2c/busses/i2c-hydra.c
+++ b/drivers/i2c/busses/i2c-hydra.c
@@ -123,7 +123,7 @@ static int __devinit hydra_probe(struct pci_dev *dev,
 		return -EBUSY;
-	hydra_bit_data.data = ioremap(base, pci_resource_len(dev, 0));
+	hydra_bit_data.data = pci_ioremap_bar(dev, 0);
 	if (hydra_bit_data.data == NULL) {
 		release_mem_region(base+offsetof(struct Hydra, CachePD), 4);
 		return -ENODEV;

Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

More information about the i2c mailing list