aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-12-12 08:01:50 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-12 08:01:50 -0800
commitd907dd2efd69195f4a5fc584a0eaecc599ca4c2c (patch)
tree839e5bb487d4a7acc1e15ce76744019f7b3efc78 /drivers
parent11c302c14d8ddc47504bd3b650bc9e8da7c717b7 (diff)
parent2a7e9a260ede3b17b5bc25c540a033a45bbf0461 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb: V4L/DVB (4954): Fix: On ia64, i2c adap->inb/adap->outb are wrongly evaluated
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/usbvision/usbvision-i2c.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c
index 92bf9a1f1e2..0f3fba7ea6f 100644
--- a/drivers/media/video/usbvision/usbvision-i2c.c
+++ b/drivers/media/video/usbvision/usbvision-i2c.c
@@ -50,6 +50,11 @@ MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
#define PDEBUG(level, fmt, args...) \
if (i2c_debug & (level)) info("[%s:%d] " fmt, __PRETTY_FUNCTION__, __LINE__ , ## args)
+static int usbvision_i2c_write(void *data, unsigned char addr, char *buf,
+ short len);
+static int usbvision_i2c_read(void *data, unsigned char addr, char *buf,
+ short len);
+
static inline int try_write_address(struct i2c_adapter *i2c_adap,
unsigned char addr, int retries)
{
@@ -61,7 +66,7 @@ static inline int try_write_address(struct i2c_adapter *i2c_adap,
data = i2c_get_adapdata(i2c_adap);
buf[0] = 0x00;
for (i = 0; i <= retries; i++) {
- ret = (adap->outb(data, addr, buf, 1));
+ ret = (usbvision_i2c_write(data, addr, buf, 1));
if (ret == 1)
break; /* success! */
udelay(5 /*adap->udelay */ );
@@ -86,7 +91,7 @@ static inline int try_read_address(struct i2c_adapter *i2c_adap,
data = i2c_get_adapdata(i2c_adap);
for (i = 0; i <= retries; i++) {
- ret = (adap->inb(data, addr, buf, 1));
+ ret = (usbvision_i2c_read(data, addr, buf, 1));
if (ret == 1)
break; /* success! */
udelay(5 /*adap->udelay */ );
@@ -153,7 +158,6 @@ static int
usb_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
{
struct i2c_msg *pmsg;
- struct i2c_algo_usb_data *adap = i2c_adap->algo_data;
void *data;
int i, ret;
unsigned char addr;
@@ -170,13 +174,13 @@ usb_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
if (pmsg->flags & I2C_M_RD) {
/* read bytes into buffer */
- ret = (adap->inb(data, addr, pmsg->buf, pmsg->len));
+ ret = (usbvision_i2c_read(data, addr, pmsg->buf, pmsg->len));
if (ret < pmsg->len) {
return (ret < 0) ? ret : -EREMOTEIO;
}
} else {
/* write bytes from buffer */
- ret = (adap->outb(data, addr, pmsg->buf, pmsg->len));
+ ret = (usbvision_i2c_write(data, addr, pmsg->buf, pmsg->len));
if (ret < pmsg->len) {
return (ret < 0) ? ret : -EREMOTEIO;
}