/* buffer overflow check */
if (req->wlen > (BUF_LEN - REQ_HDR_LEN - CHECKSUM_LEN) ||
- req->rlen > (BUF_LEN - ACK_HDR_LEN - CHECKSUM_LEN)) {
- pr_debug("%s: too much data wlen=%d rlen=%d\n", __func__,
- req->wlen, req->rlen);
+ req->rlen > (BUF_LEN - ACK_HDR_LEN - CHECKSUM_LEN)) {
+ dev_err(&d->udev->dev, "%s: too much data wlen=%d rlen=%d\n",
+ __func__, req->wlen, req->rlen);
return -EINVAL;
}
checksum = af9035_checksum(buf, rlen - 2);
tmp_checksum = (buf[rlen - 2] << 8) | buf[rlen - 1];
if (tmp_checksum != checksum) {
- pr_err("%s: command=%02x checksum mismatch (%04x != %04x)\n",
- KBUILD_MODNAME, req->cmd, tmp_checksum,
- checksum);
+ dev_err(&d->udev->dev, "%s: command=%02x checksum mismatch " \
+ "(%04x != %04x)\n", KBUILD_MODNAME, req->cmd,
+ tmp_checksum, checksum);
ret = -EIO;
goto err;
}
/* check status */
if (buf[2]) {
- pr_debug("%s: command=%02x failed fw error=%d\n", __func__,
- req->cmd, buf[2]);
+ dev_dbg(&d->udev->dev, "%s: command=%02x failed fw error=%d\n",
+ __func__, req->cmd, buf[2]);
ret = -EIO;
goto err;
}
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
if (ret < 0)
goto err;
- pr_debug("%s: reply=%*ph\n", __func__, 4, rbuf);
+ dev_dbg(&d->udev->dev, "%s: reply=%*ph\n", __func__, 4, rbuf);
if (rbuf[0] || rbuf[1] || rbuf[2] || rbuf[3])
ret = WARM;
else
return ret;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
hdr_checksum = fw->data[fw->size - i + 5] << 8;
hdr_checksum |= fw->data[fw->size - i + 6] << 0;
- pr_debug("%s: core=%d addr=%04x data_len=%d checksum=%04x\n",
- __func__, hdr_core, hdr_addr, hdr_data_len,
- hdr_checksum);
+ dev_dbg(&d->udev->dev, "%s: core=%d addr=%04x data_len=%d " \
+ "checksum=%04x\n", __func__, hdr_core, hdr_addr,
+ hdr_data_len, hdr_checksum);
if (((hdr_core != 1) && (hdr_core != 2)) ||
(hdr_data_len > i)) {
- pr_debug("%s: bad firmware\n", __func__);
+ dev_dbg(&d->udev->dev, "%s: bad firmware\n", __func__);
break;
}
i -= hdr_data_len + HDR_SIZE;
- pr_debug("%s: data uploaded=%zu\n", __func__, fw->size - i);
+ dev_dbg(&d->udev->dev, "%s: data uploaded=%zu\n",
+ __func__, fw->size - i);
}
/* firmware loaded, request boot */
goto err;
if (!(rbuf[0] || rbuf[1] || rbuf[2] || rbuf[3])) {
- pr_err("%s: firmware did not run\n", KBUILD_MODNAME);
+ dev_err(&d->udev->dev, "%s: firmware did not run\n",
+ KBUILD_MODNAME);
ret = -ENODEV;
goto err;
}
- pr_info("%s: firmware version=%d.%d.%d.%d", KBUILD_MODNAME,
- rbuf[0], rbuf[1], rbuf[2], rbuf[3]);
+ dev_info(&d->udev->dev, "%s: firmware version=%d.%d.%d.%d",
+ KBUILD_MODNAME, rbuf[0], rbuf[1], rbuf[2], rbuf[3]);
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
if (ret < 0)
goto err;
- pr_debug("%s: data uploaded=%d\n", __func__, i);
+ dev_dbg(&d->udev->dev, "%s: data uploaded=%d\n",
+ __func__, i);
}
}
goto err;
if (!(rbuf[0] || rbuf[1] || rbuf[2] || rbuf[3])) {
- pr_err("%s: firmware did not run\n", KBUILD_MODNAME);
+ dev_err(&d->udev->dev, "%s: firmware did not run\n",
+ KBUILD_MODNAME);
ret = -ENODEV;
goto err;
}
- pr_info("%s: firmware version=%d.%d.%d.%d", KBUILD_MODNAME,
- rbuf[0], rbuf[1], rbuf[2], rbuf[3]);
+ dev_info(&d->udev->dev, "%s: firmware version=%d.%d.%d.%d",
+ KBUILD_MODNAME, rbuf[0], rbuf[1], rbuf[2], rbuf[3]);
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
goto err;
state->dual_mode = tmp;
- pr_debug("%s: dual mode=%d\n", __func__, state->dual_mode);
+ dev_dbg(&d->udev->dev, "%s: dual mode=%d\n",
+ __func__, state->dual_mode);
for (i = 0; i < state->dual_mode + 1; i++) {
/* tuner */
goto err;
state->af9033_config[i].tuner = tmp;
- pr_debug("%s: [%d]tuner=%02x\n", __func__, i, tmp);
+ dev_dbg(&d->udev->dev, "%s: [%d]tuner=%02x\n",
+ __func__, i, tmp);
switch (tmp) {
case AF9033_TUNER_TUA9001:
state->af9033_config[i].spec_inv = 1;
break;
default:
- pr_info("%s: tuner ID=%02x not supported, please " \
- "report!", KBUILD_MODNAME, tmp);
+ dev_warn(&d->udev->dev, "%s: tuner id=%02x not " \
+ "supported, please report!",
+ KBUILD_MODNAME, tmp);
};
/* tuner IF frequency */
tmp16 |= tmp << 8;
- pr_debug("%s: [%d]IF=%d\n", __func__, i, tmp16);
+ dev_dbg(&d->udev->dev, "%s: [%d]IF=%d\n", __func__, i, tmp16);
eeprom_shift = 0x10; /* shift for the 2nd tuner params */
}
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
{ 0x80f9a4, 0x00, 0x01 },
};
- pr_debug("%s: USB speed=%d frame_size=%04x packet_size=%02x\n",
- __func__, d->udev->speed, frame_size, packet_size);
+ dev_dbg(&d->udev->dev, "%s: USB speed=%d frame_size=%04x " \
+ "packet_size=%02x\n", __func__,
+ d->udev->speed, frame_size, packet_size);
/* init endpoints */
for (i = 0; i < ARRAY_SIZE(tab); i++) {
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
if (ret < 0)
goto err;
- pr_debug("%s: ir_mode=%02x\n", __func__, tmp);
+ dev_dbg(&d->udev->dev, "%s: ir_mode=%02x\n", __func__, tmp);
/* don't activate rc if in HID mode or if not available */
if (tmp == 5) {
if (ret < 0)
goto err;
- pr_debug("%s: ir_type=%02x\n", __func__, tmp);
+ dev_dbg(&d->udev->dev, "%s: ir_type=%02x\n", __func__, tmp);
switch (tmp) {
case 0: /* NEC */
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}