aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-12-11 03:37:14 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-12 04:37:09 -0500
commit2a7e9a260ede3b17b5bc25c540a033a45bbf0461 (patch)
tree69e4b24c41aca091b38a9af40653ecae948784c3 /drivers/media
parent4259cb25d436a79bf6b07d8075423573567c211d (diff)
V4L/DVB (4954): Fix: On ia64, i2c adap->inb/adap->outb are wrongly evaluated
i2c defines two callbacks (inb/outb). On ia64, since it defines also two macros with those names, it causes the following errors: drivers/media/video/usbvision/usbvision-i2c.c:64:39: macro "outb" passed 4 arguments, but takes just 2 drivers/media/video/usbvision/usbvision-i2c.c: In function `try_write_address': drivers/media/video/usbvision/usbvision-i2c.c:64: warning: assignment makes integer from pointer without a cast drivers/media/video/usbvision/usbvision-i2c.c:89:38: macro "inb" passed 4 arguments, but takes just 1 drivers/media/video/usbvision/usbvision-i2c.c: In function `try_read_address': drivers/media/video/usbvision/usbvision-i2c.c:89: warning: assignment makes integer from pointer without a cast drivers/media/video/usbvision/usbvision-i2c.c:85: warning: unused variable `buf' drivers/media/video/usbvision/usbvision-i2c.c:173:53: macro "inb" passed 4 arguments, but takes just 1 drivers/media/video/usbvision/usbvision-i2c.c: In function `usb_xfer': drivers/media/video/usbvision/usbvision-i2c.c:173: warning: assignment makes integer from pointer without a cast drivers/media/video/usbvision/usbvision-i2c.c:179:54: macro "outb" passed 4 arguments, but takes just 2 drivers/media/video/usbvision/usbvision-i2c.c:179: warning: assignment makes integer from pointer without a cast thanks to Andrew Morton for pointing this. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-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 92bf9a1f1e2c..0f3fba7ea6fe 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]");
50#define PDEBUG(level, fmt, args...) \ 50#define PDEBUG(level, fmt, args...) \
51 if (i2c_debug & (level)) info("[%s:%d] " fmt, __PRETTY_FUNCTION__, __LINE__ , ## args) 51 if (i2c_debug & (level)) info("[%s:%d] " fmt, __PRETTY_FUNCTION__, __LINE__ , ## args)
52 52
53static int usbvision_i2c_write(void *data, unsigned char addr, char *buf,
54 short len);
55static int usbvision_i2c_read(void *data, unsigned char addr, char *buf,
56 short len);
57
53static inline int try_write_address(struct i2c_adapter *i2c_adap, 58static inline int try_write_address(struct i2c_adapter *i2c_adap,
54 unsigned char addr, int retries) 59 unsigned char addr, int retries)
55{ 60{
@@ -61,7 +66,7 @@ static inline int try_write_address(struct i2c_adapter *i2c_adap,
61 data = i2c_get_adapdata(i2c_adap); 66 data = i2c_get_adapdata(i2c_adap);
62 buf[0] = 0x00; 67 buf[0] = 0x00;
63 for (i = 0; i <= retries; i++) { 68 for (i = 0; i <= retries; i++) {
64 ret = (adap->outb(data, addr, buf, 1)); 69 ret = (usbvision_i2c_write(data, addr, buf, 1));
65 if (ret == 1) 70 if (ret == 1)
66 break; /* success! */ 71 break; /* success! */
67 udelay(5 /*adap->udelay */ ); 72 udelay(5 /*adap->udelay */ );
@@ -86,7 +91,7 @@ static inline int try_read_address(struct i2c_adapter *i2c_adap,
86 91
87 data = i2c_get_adapdata(i2c_adap); 92 data = i2c_get_adapdata(i2c_adap);
88 for (i = 0; i <= retries; i++) { 93 for (i = 0; i <= retries; i++) {
89 ret = (adap->inb(data, addr, buf, 1)); 94 ret = (usbvision_i2c_read(data, addr, buf, 1));
90 if (ret == 1) 95 if (ret == 1)
91 break; /* success! */ 96 break; /* success! */
92 udelay(5 /*adap->udelay */ ); 97 udelay(5 /*adap->udelay */ );
@@ -153,7 +158,6 @@ static int
153usb_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) 158usb_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
154{ 159{
155 struct i2c_msg *pmsg; 160 struct i2c_msg *pmsg;
156 struct i2c_algo_usb_data *adap = i2c_adap->algo_data;
157 void *data; 161 void *data;
158 int i, ret; 162 int i, ret;
159 unsigned char addr; 163 unsigned char addr;
@@ -170,13 +174,13 @@ usb_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
170 174
171 if (pmsg->flags & I2C_M_RD) { 175 if (pmsg->flags & I2C_M_RD) {
172 /* read bytes into buffer */ 176 /* read bytes into buffer */
173 ret = (adap->inb(data, addr, pmsg->buf, pmsg->len)); 177 ret = (usbvision_i2c_read(data, addr, pmsg->buf, pmsg->len));
174 if (ret < pmsg->len) { 178 if (ret < pmsg->len) {
175 return (ret < 0) ? ret : -EREMOTEIO; 179 return (ret < 0) ? ret : -EREMOTEIO;
176 } 180 }
177 } else { 181 } else {
178 /* write bytes from buffer */ 182 /* write bytes from buffer */
179 ret = (adap->outb(data, addr, pmsg->buf, pmsg->len)); 183 ret = (usbvision_i2c_write(data, addr, pmsg->buf, pmsg->len));
180 if (ret < pmsg->len) { 184 if (ret < pmsg->len) {
181 return (ret < 0) ? ret : -EREMOTEIO; 185 return (ret < 0) ? ret : -EREMOTEIO;
182 } 186 }