request = DEMOD_RW;
break;
default:
- pr_err("%s: unknown command=%02x\n", KBUILD_MODNAME, req->cmd);
+ dev_err(&d->udev->dev, "%s: unknown command=%02x\n",
+ KBUILD_MODNAME, req->cmd);
ret = -EINVAL;
goto error;
}
err_dealloc:
kfree(buf);
error:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
ret = ec168_ctrl_msg(d, &req);
i += 2;
} else {
- pr_err("%s: I2C read not implemented\n",
+ dev_err(&d->udev->dev, "%s: I2C read not " \
+ "implemented\n",
KBUILD_MODNAME);
ret = -EOPNOTSUPP;
i += 2;
int ret;
u8 reply;
struct ec168_req req = {GET_CONFIG, 0, 1, sizeof(reply), &reply};
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
ret = ec168_ctrl_msg(d, &req);
if (ret)
goto error;
- pr_debug("%s: reply=%02x\n", __func__, reply);
+ dev_dbg(&d->udev->dev, "%s: reply=%02x\n", __func__, reply);
if (reply == 0x01)
ret = WARM;
return ret;
error:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
{
int ret, len, remaining;
struct ec168_req req = {DOWNLOAD_FIRMWARE, 0, 0, 0, NULL};
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
#define LEN_MAX 2048 /* max packet size */
for (remaining = fw->size; remaining > 0; remaining -= LEN_MAX) {
ret = ec168_ctrl_msg(d, &req);
if (ret) {
- pr_err("%s: firmware download failed=%d\n",
+ dev_err(&d->udev->dev,
+ "%s: firmware download failed=%d\n",
KBUILD_MODNAME, ret);
goto error;
}
return ret;
error:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
static int ec168_ec100_frontend_attach(struct dvb_usb_adapter *adap)
{
- pr_debug("%s:\n", __func__);
+ struct dvb_usb_device *d = adap_to_d(adap);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
+
adap->fe[0] = dvb_attach(ec100_attach, &ec168_ec100_config,
- &adap_to_d(adap)->i2c_adap);
+ &d->i2c_adap);
if (adap->fe[0] == NULL)
return -ENODEV;
static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
{
- pr_debug("%s:\n", __func__);
- return dvb_attach(mxl5005s_attach, adap->fe[0],
- &adap_to_d(adap)->i2c_adap,
+ struct dvb_usb_device *d = adap_to_d(adap);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
+
+ return dvb_attach(mxl5005s_attach, adap->fe[0], &d->i2c_adap,
&ec168_mxl5003s_config) == NULL ? -ENODEV : 0;
}
static int ec168_streaming_ctrl(struct dvb_frontend *fe, int onoff)
{
+ struct dvb_usb_device *d = fe_to_d(fe);
struct ec168_req req = {STREAMING_CTRL, 0x7f01, 0x0202, 0, NULL};
- pr_debug("%s: onoff=%d\n", __func__, onoff);
+ dev_dbg(&d->udev->dev, "%s: onoff=%d\n", __func__, onoff);
+
if (onoff)
req.index = 0x0102;
- return ec168_ctrl_msg(fe_to_d(fe), &req);
+ return ec168_ctrl_msg(d, &req);
}
/* DVB USB Driver stuff */