Commit d230d5ad authored by Frank Schaefer's avatar Frank Schaefer Committed by Mauro Carvalho Chehab

[media] em28xx-i2c: do not break strings across lines

Signed-off-by: default avatarFrank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent af2d68d1
...@@ -68,8 +68,8 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) ...@@ -68,8 +68,8 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
/* trigger write */ /* trigger write */
ret = dev->em28xx_write_regs(dev, 4 - len, &b2[4 - len], 2 + len); ret = dev->em28xx_write_regs(dev, 4 - len, &b2[4 - len], 2 + len);
if (ret != 2 + len) { if (ret != 2 + len) {
em28xx_warn("failed to trigger write to i2c address 0x%x " em28xx_warn("failed to trigger write to i2c address 0x%x (error=%i)\n",
"(error=%i)\n", addr, ret); addr, ret);
return (ret < 0) ? ret : -EIO; return (ret < 0) ? ret : -EIO;
} }
/* wait for completion */ /* wait for completion */
...@@ -81,8 +81,8 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) ...@@ -81,8 +81,8 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
} else if (ret == 0x94 + len - 1) { } else if (ret == 0x94 + len - 1) {
return -ENODEV; return -ENODEV;
} else if (ret < 0) { } else if (ret < 0) {
em28xx_warn("failed to get i2c transfer status from " em28xx_warn("failed to get i2c transfer status from bridge register (error=%i)\n",
"bridge register (error=%i)\n", ret); ret);
return ret; return ret;
} }
msleep(5); msleep(5);
...@@ -110,8 +110,8 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) ...@@ -110,8 +110,8 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
buf2[0] = addr; buf2[0] = addr;
ret = dev->em28xx_write_regs(dev, 0x04, buf2, 2); ret = dev->em28xx_write_regs(dev, 0x04, buf2, 2);
if (ret != 2) { if (ret != 2) {
em28xx_warn("failed to trigger read from i2c address 0x%x " em28xx_warn("failed to trigger read from i2c address 0x%x (error=%i)\n",
"(error=%i)\n", addr, ret); addr, ret);
return (ret < 0) ? ret : -EIO; return (ret < 0) ? ret : -EIO;
} }
...@@ -124,8 +124,8 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) ...@@ -124,8 +124,8 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
} else if (ret == 0x94 + len - 1) { } else if (ret == 0x94 + len - 1) {
return -ENODEV; return -ENODEV;
} else if (ret < 0) { } else if (ret < 0) {
em28xx_warn("failed to get i2c transfer status from " em28xx_warn("failed to get i2c transfer status from bridge register (error=%i)\n",
"bridge register (error=%i)\n", ret); ret);
return ret; return ret;
} }
msleep(5); msleep(5);
...@@ -136,9 +136,8 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) ...@@ -136,9 +136,8 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
/* get the received message */ /* get the received message */
ret = dev->em28xx_read_reg_req_len(dev, 0x00, 4-len, buf2, len); ret = dev->em28xx_read_reg_req_len(dev, 0x00, 4-len, buf2, len);
if (ret != len) { if (ret != len) {
em28xx_warn("reading from i2c device at 0x%x failed: " em28xx_warn("reading from i2c device at 0x%x failed: couldn't get the received message from the bridge (error=%i)\n",
"couldn't get the received message from the bridge " addr, ret);
"(error=%i)\n", addr, ret);
return (ret < 0) ? ret : -EIO; return (ret < 0) ? ret : -EIO;
} }
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
...@@ -179,12 +178,11 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, ...@@ -179,12 +178,11 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
ret = dev->em28xx_write_regs_req(dev, stop ? 2 : 3, addr, buf, len); ret = dev->em28xx_write_regs_req(dev, stop ? 2 : 3, addr, buf, len);
if (ret != len) { if (ret != len) {
if (ret < 0) { if (ret < 0) {
em28xx_warn("writing to i2c device at 0x%x failed " em28xx_warn("writing to i2c device at 0x%x failed (error=%i)\n",
"(error=%i)\n", addr, ret); addr, ret);
return ret; return ret;
} else { } else {
em28xx_warn("%i bytes write to i2c device at 0x%x " em28xx_warn("%i bytes write to i2c device at 0x%x requested, but %i bytes written\n",
"requested, but %i bytes written\n",
len, addr, ret); len, addr, ret);
return -EIO; return -EIO;
} }
...@@ -199,8 +197,8 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, ...@@ -199,8 +197,8 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
} else if (ret == 0x10) { } else if (ret == 0x10) {
return -ENODEV; return -ENODEV;
} else if (ret < 0) { } else if (ret < 0) {
em28xx_warn("failed to read i2c transfer status from " em28xx_warn("failed to read i2c transfer status from bridge (error=%i)\n",
"bridge (error=%i)\n", ret); ret);
return ret; return ret;
} }
msleep(5); msleep(5);
...@@ -243,8 +241,8 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len) ...@@ -243,8 +241,8 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len)
/* Check success of the i2c operation */ /* Check success of the i2c operation */
ret = dev->em28xx_read_reg(dev, 0x05); ret = dev->em28xx_read_reg(dev, 0x05);
if (ret < 0) { if (ret < 0) {
em28xx_warn("failed to read i2c transfer status from " em28xx_warn("failed to read i2c transfer status from bridge (error=%i)\n",
"bridge (error=%i)\n", ret); ret);
return ret; return ret;
} }
if (ret > 0) { if (ret > 0) {
...@@ -494,12 +492,10 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, ...@@ -494,12 +492,10 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
dev->hash = em28xx_hash_mem(data, len, 32); dev->hash = em28xx_hash_mem(data, len, 32);
mc_start = (data[1] << 8) + 4; /* usually 0x0004 */ mc_start = (data[1] << 8) + 4; /* usually 0x0004 */
em28xx_info("EEPROM ID = %02x %02x %02x %02x, " em28xx_info("EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n",
"EEPROM hash = 0x%08lx\n",
data[0], data[1], data[2], data[3], dev->hash); data[0], data[1], data[2], data[3], dev->hash);
em28xx_info("EEPROM info:\n"); em28xx_info("EEPROM info:\n");
em28xx_info("\tmicrocode start address = 0x%04x, " em28xx_info("\tmicrocode start address = 0x%04x, boot configuration = 0x%02x\n",
"boot configuration = 0x%02x\n",
mc_start, data[2]); mc_start, data[2]);
/* boot configuration (address 0x0002): /* boot configuration (address 0x0002):
* [0] microcode download speed: 1 = 400 kHz; 0 = 100 kHz * [0] microcode download speed: 1 = 400 kHz; 0 = 100 kHz
...@@ -552,8 +548,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, ...@@ -552,8 +548,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
data[0] == 0x1a && data[1] == 0xeb && data[0] == 0x1a && data[1] == 0xeb &&
data[2] == 0x67 && data[3] == 0x95) { data[2] == 0x67 && data[3] == 0x95) {
dev->hash = em28xx_hash_mem(data, len, 32); dev->hash = em28xx_hash_mem(data, len, 32);
em28xx_info("EEPROM ID = %02x %02x %02x %02x, " em28xx_info("EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n",
"EEPROM hash = 0x%08lx\n",
data[0], data[1], data[2], data[3], dev->hash); data[0], data[1], data[2], data[3], dev->hash);
em28xx_info("EEPROM info:\n"); em28xx_info("EEPROM info:\n");
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment