Skip to content

Commit

Permalink
[media] em28xx-i2c: do not break strings across lines
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Frank Schaefer authored and Mauro Carvalho Chehab committed Mar 25, 2013
1 parent af2d68d commit d230d5a
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions drivers/media/usb/em28xx/em28xx-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
/* trigger write */
ret = dev->em28xx_write_regs(dev, 4 - len, &b2[4 - len], 2 + len);
if (ret != 2 + len) {
em28xx_warn("failed to trigger write to i2c address 0x%x "
"(error=%i)\n", addr, ret);
em28xx_warn("failed to trigger write to i2c address 0x%x (error=%i)\n",
addr, ret);
return (ret < 0) ? ret : -EIO;
}
/* wait for completion */
Expand All @@ -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) {
return -ENODEV;
} else if (ret < 0) {
em28xx_warn("failed to get i2c transfer status from "
"bridge register (error=%i)\n", ret);
em28xx_warn("failed to get i2c transfer status from bridge register (error=%i)\n",
ret);
return ret;
}
msleep(5);
Expand Down Expand Up @@ -110,8 +110,8 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
buf2[0] = addr;
ret = dev->em28xx_write_regs(dev, 0x04, buf2, 2);
if (ret != 2) {
em28xx_warn("failed to trigger read from i2c address 0x%x "
"(error=%i)\n", addr, ret);
em28xx_warn("failed to trigger read from i2c address 0x%x (error=%i)\n",
addr, ret);
return (ret < 0) ? ret : -EIO;
}

Expand All @@ -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) {
return -ENODEV;
} else if (ret < 0) {
em28xx_warn("failed to get i2c transfer status from "
"bridge register (error=%i)\n", ret);
em28xx_warn("failed to get i2c transfer status from bridge register (error=%i)\n",
ret);
return ret;
}
msleep(5);
Expand All @@ -136,9 +136,8 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
/* get the received message */
ret = dev->em28xx_read_reg_req_len(dev, 0x00, 4-len, buf2, len);
if (ret != len) {
em28xx_warn("reading from i2c device at 0x%x failed: "
"couldn't get the received message from the bridge "
"(error=%i)\n", addr, ret);
em28xx_warn("reading from i2c device at 0x%x failed: couldn't get the received message from the bridge (error=%i)\n",
addr, ret);
return (ret < 0) ? ret : -EIO;
}
for (i = 0; i < len; i++)
Expand Down Expand Up @@ -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);
if (ret != len) {
if (ret < 0) {
em28xx_warn("writing to i2c device at 0x%x failed "
"(error=%i)\n", addr, ret);
em28xx_warn("writing to i2c device at 0x%x failed (error=%i)\n",
addr, ret);
return ret;
} else {
em28xx_warn("%i bytes write to i2c device at 0x%x "
"requested, but %i bytes written\n",
em28xx_warn("%i bytes write to i2c device at 0x%x requested, but %i bytes written\n",
len, addr, ret);
return -EIO;
}
Expand All @@ -199,8 +197,8 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
} else if (ret == 0x10) {
return -ENODEV;
} else if (ret < 0) {
em28xx_warn("failed to read i2c transfer status from "
"bridge (error=%i)\n", ret);
em28xx_warn("failed to read i2c transfer status from bridge (error=%i)\n",
ret);
return ret;
}
msleep(5);
Expand Down Expand Up @@ -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 */
ret = dev->em28xx_read_reg(dev, 0x05);
if (ret < 0) {
em28xx_warn("failed to read i2c transfer status from "
"bridge (error=%i)\n", ret);
em28xx_warn("failed to read i2c transfer status from bridge (error=%i)\n",
ret);
return ret;
}
if (ret > 0) {
Expand Down Expand Up @@ -494,12 +492,10 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
dev->hash = em28xx_hash_mem(data, len, 32);
mc_start = (data[1] << 8) + 4; /* usually 0x0004 */

em28xx_info("EEPROM ID = %02x %02x %02x %02x, "
"EEPROM hash = 0x%08lx\n",
em28xx_info("EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n",
data[0], data[1], data[2], data[3], dev->hash);
em28xx_info("EEPROM info:\n");
em28xx_info("\tmicrocode start address = 0x%04x, "
"boot configuration = 0x%02x\n",
em28xx_info("\tmicrocode start address = 0x%04x, boot configuration = 0x%02x\n",
mc_start, data[2]);
/* boot configuration (address 0x0002):
* [0] microcode download speed: 1 = 400 kHz; 0 = 100 kHz
Expand Down Expand Up @@ -552,8 +548,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
data[0] == 0x1a && data[1] == 0xeb &&
data[2] == 0x67 && data[3] == 0x95) {
dev->hash = em28xx_hash_mem(data, len, 32);
em28xx_info("EEPROM ID = %02x %02x %02x %02x, "
"EEPROM hash = 0x%08lx\n",
em28xx_info("EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n",
data[0], data[1], data[2], data[3], dev->hash);
em28xx_info("EEPROM info:\n");
} else {
Expand Down

0 comments on commit d230d5a

Please sign in to comment.