Commit 3cedcab8 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] ec168: use Kernel dev_foo() logging

Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 81527688
...@@ -61,7 +61,8 @@ static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req) ...@@ -61,7 +61,8 @@ static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req)
request = DEMOD_RW; request = DEMOD_RW;
break; break;
default: 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; ret = -EINVAL;
goto error; goto error;
} }
...@@ -104,7 +105,7 @@ static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req) ...@@ -104,7 +105,7 @@ static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req)
err_dealloc: err_dealloc:
kfree(buf); kfree(buf);
error: error:
pr_debug("%s: failed=%d\n", __func__, ret); dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret; return ret;
} }
...@@ -136,7 +137,8 @@ static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], ...@@ -136,7 +137,8 @@ static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
ret = ec168_ctrl_msg(d, &req); ret = ec168_ctrl_msg(d, &req);
i += 2; i += 2;
} else { } else {
pr_err("%s: I2C read not implemented\n", dev_err(&d->udev->dev, "%s: I2C read not " \
"implemented\n",
KBUILD_MODNAME); KBUILD_MODNAME);
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
i += 2; i += 2;
...@@ -187,13 +189,13 @@ static int ec168_identify_state(struct dvb_usb_device *d, const char **name) ...@@ -187,13 +189,13 @@ static int ec168_identify_state(struct dvb_usb_device *d, const char **name)
int ret; int ret;
u8 reply; u8 reply;
struct ec168_req req = {GET_CONFIG, 0, 1, sizeof(reply), &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); ret = ec168_ctrl_msg(d, &req);
if (ret) if (ret)
goto error; goto error;
pr_debug("%s: reply=%02x\n", __func__, reply); dev_dbg(&d->udev->dev, "%s: reply=%02x\n", __func__, reply);
if (reply == 0x01) if (reply == 0x01)
ret = WARM; ret = WARM;
...@@ -202,7 +204,7 @@ static int ec168_identify_state(struct dvb_usb_device *d, const char **name) ...@@ -202,7 +204,7 @@ static int ec168_identify_state(struct dvb_usb_device *d, const char **name)
return ret; return ret;
error: error:
pr_debug("%s: failed=%d\n", __func__, ret); dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret; return ret;
} }
...@@ -211,7 +213,7 @@ static int ec168_download_firmware(struct dvb_usb_device *d, ...@@ -211,7 +213,7 @@ static int ec168_download_firmware(struct dvb_usb_device *d,
{ {
int ret, len, remaining; int ret, len, remaining;
struct ec168_req req = {DOWNLOAD_FIRMWARE, 0, 0, 0, NULL}; 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 */ #define LEN_MAX 2048 /* max packet size */
for (remaining = fw->size; remaining > 0; remaining -= LEN_MAX) { for (remaining = fw->size; remaining > 0; remaining -= LEN_MAX) {
...@@ -225,7 +227,8 @@ static int ec168_download_firmware(struct dvb_usb_device *d, ...@@ -225,7 +227,8 @@ static int ec168_download_firmware(struct dvb_usb_device *d,
ret = ec168_ctrl_msg(d, &req); ret = ec168_ctrl_msg(d, &req);
if (ret) { if (ret) {
pr_err("%s: firmware download failed=%d\n", dev_err(&d->udev->dev,
"%s: firmware download failed=%d\n",
KBUILD_MODNAME, ret); KBUILD_MODNAME, ret);
goto error; goto error;
} }
...@@ -259,7 +262,7 @@ static int ec168_download_firmware(struct dvb_usb_device *d, ...@@ -259,7 +262,7 @@ static int ec168_download_firmware(struct dvb_usb_device *d,
return ret; return ret;
error: error:
pr_debug("%s: failed=%d\n", __func__, ret); dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret; return ret;
} }
...@@ -269,9 +272,11 @@ static struct ec100_config ec168_ec100_config = { ...@@ -269,9 +272,11 @@ static struct ec100_config ec168_ec100_config = {
static int ec168_ec100_frontend_attach(struct dvb_usb_adapter *adap) 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->fe[0] = dvb_attach(ec100_attach, &ec168_ec100_config,
&adap_to_d(adap)->i2c_adap); &d->i2c_adap);
if (adap->fe[0] == NULL) if (adap->fe[0] == NULL)
return -ENODEV; return -ENODEV;
...@@ -297,19 +302,22 @@ static struct mxl5005s_config ec168_mxl5003s_config = { ...@@ -297,19 +302,22 @@ static struct mxl5005s_config ec168_mxl5003s_config = {
static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
{ {
pr_debug("%s:\n", __func__); struct dvb_usb_device *d = adap_to_d(adap);
return dvb_attach(mxl5005s_attach, adap->fe[0], dev_dbg(&d->udev->dev, "%s:\n", __func__);
&adap_to_d(adap)->i2c_adap,
return dvb_attach(mxl5005s_attach, adap->fe[0], &d->i2c_adap,
&ec168_mxl5003s_config) == NULL ? -ENODEV : 0; &ec168_mxl5003s_config) == NULL ? -ENODEV : 0;
} }
static int ec168_streaming_ctrl(struct dvb_frontend *fe, int onoff) 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}; 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) if (onoff)
req.index = 0x0102; req.index = 0x0102;
return ec168_ctrl_msg(fe_to_d(fe), &req); return ec168_ctrl_msg(d, &req);
} }
/* DVB USB Driver stuff */ /* DVB USB Driver stuff */
......
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