aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-09-12 19:23:56 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-23 19:50:28 -0400
commit3cedcab88f6ef96bcbe0c70d15c5d841086f9d43 (patch)
treed4cd80bfb498ed509915092e808247509a0f7963 /drivers/media/usb
parent81527688924ace05cc99907713f14eb2ec064c37 (diff)
[media] ec168: use Kernel dev_foo() logging
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/dvb-usb-v2/ec168.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/ec168.c b/drivers/media/usb/dvb-usb-v2/ec168.c
index b6a9c5b5e8ad..5c68f3918bc8 100644
--- a/drivers/media/usb/dvb-usb-v2/ec168.c
+++ b/drivers/media/usb/dvb-usb-v2/ec168.c
@@ -61,7 +61,8 @@ static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req)
61 request = DEMOD_RW; 61 request = DEMOD_RW;
62 break; 62 break;
63 default: 63 default:
64 pr_err("%s: unknown command=%02x\n", KBUILD_MODNAME, req->cmd); 64 dev_err(&d->udev->dev, "%s: unknown command=%02x\n",
65 KBUILD_MODNAME, req->cmd);
65 ret = -EINVAL; 66 ret = -EINVAL;
66 goto error; 67 goto error;
67 } 68 }
@@ -104,7 +105,7 @@ static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req)
104err_dealloc: 105err_dealloc:
105 kfree(buf); 106 kfree(buf);
106error: 107error:
107 pr_debug("%s: failed=%d\n", __func__, ret); 108 dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
108 return ret; 109 return ret;
109} 110}
110 111
@@ -136,7 +137,8 @@ static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
136 ret = ec168_ctrl_msg(d, &req); 137 ret = ec168_ctrl_msg(d, &req);
137 i += 2; 138 i += 2;
138 } else { 139 } else {
139 pr_err("%s: I2C read not implemented\n", 140 dev_err(&d->udev->dev, "%s: I2C read not " \
141 "implemented\n",
140 KBUILD_MODNAME); 142 KBUILD_MODNAME);
141 ret = -EOPNOTSUPP; 143 ret = -EOPNOTSUPP;
142 i += 2; 144 i += 2;
@@ -187,13 +189,13 @@ static int ec168_identify_state(struct dvb_usb_device *d, const char **name)
187 int ret; 189 int ret;
188 u8 reply; 190 u8 reply;
189 struct ec168_req req = {GET_CONFIG, 0, 1, sizeof(reply), &reply}; 191 struct ec168_req req = {GET_CONFIG, 0, 1, sizeof(reply), &reply};
190 pr_debug("%s:\n", __func__); 192 dev_dbg(&d->udev->dev, "%s:\n", __func__);
191 193
192 ret = ec168_ctrl_msg(d, &req); 194 ret = ec168_ctrl_msg(d, &req);
193 if (ret) 195 if (ret)
194 goto error; 196 goto error;
195 197
196 pr_debug("%s: reply=%02x\n", __func__, reply); 198 dev_dbg(&d->udev->dev, "%s: reply=%02x\n", __func__, reply);
197 199
198 if (reply == 0x01) 200 if (reply == 0x01)
199 ret = WARM; 201 ret = WARM;
@@ -202,7 +204,7 @@ static int ec168_identify_state(struct dvb_usb_device *d, const char **name)
202 204
203 return ret; 205 return ret;
204error: 206error:
205 pr_debug("%s: failed=%d\n", __func__, ret); 207 dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
206 return ret; 208 return ret;
207} 209}
208 210
@@ -211,7 +213,7 @@ static int ec168_download_firmware(struct dvb_usb_device *d,
211{ 213{
212 int ret, len, remaining; 214 int ret, len, remaining;
213 struct ec168_req req = {DOWNLOAD_FIRMWARE, 0, 0, 0, NULL}; 215 struct ec168_req req = {DOWNLOAD_FIRMWARE, 0, 0, 0, NULL};
214 pr_debug("%s:\n", __func__); 216 dev_dbg(&d->udev->dev, "%s:\n", __func__);
215 217
216 #define LEN_MAX 2048 /* max packet size */ 218 #define LEN_MAX 2048 /* max packet size */
217 for (remaining = fw->size; remaining > 0; remaining -= LEN_MAX) { 219 for (remaining = fw->size; remaining > 0; remaining -= LEN_MAX) {
@@ -225,7 +227,8 @@ static int ec168_download_firmware(struct dvb_usb_device *d,
225 227
226 ret = ec168_ctrl_msg(d, &req); 228 ret = ec168_ctrl_msg(d, &req);
227 if (ret) { 229 if (ret) {
228 pr_err("%s: firmware download failed=%d\n", 230 dev_err(&d->udev->dev,
231 "%s: firmware download failed=%d\n",
229 KBUILD_MODNAME, ret); 232 KBUILD_MODNAME, ret);
230 goto error; 233 goto error;
231 } 234 }
@@ -259,7 +262,7 @@ static int ec168_download_firmware(struct dvb_usb_device *d,
259 262
260 return ret; 263 return ret;
261error: 264error:
262 pr_debug("%s: failed=%d\n", __func__, ret); 265 dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
263 return ret; 266 return ret;
264} 267}
265 268
@@ -269,9 +272,11 @@ static struct ec100_config ec168_ec100_config = {
269 272
270static int ec168_ec100_frontend_attach(struct dvb_usb_adapter *adap) 273static int ec168_ec100_frontend_attach(struct dvb_usb_adapter *adap)
271{ 274{
272 pr_debug("%s:\n", __func__); 275 struct dvb_usb_device *d = adap_to_d(adap);
276 dev_dbg(&d->udev->dev, "%s:\n", __func__);
277
273 adap->fe[0] = dvb_attach(ec100_attach, &ec168_ec100_config, 278 adap->fe[0] = dvb_attach(ec100_attach, &ec168_ec100_config,
274 &adap_to_d(adap)->i2c_adap); 279 &d->i2c_adap);
275 if (adap->fe[0] == NULL) 280 if (adap->fe[0] == NULL)
276 return -ENODEV; 281 return -ENODEV;
277 282
@@ -297,19 +302,22 @@ static struct mxl5005s_config ec168_mxl5003s_config = {
297 302
298static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) 303static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
299{ 304{
300 pr_debug("%s:\n", __func__); 305 struct dvb_usb_device *d = adap_to_d(adap);
301 return dvb_attach(mxl5005s_attach, adap->fe[0], 306 dev_dbg(&d->udev->dev, "%s:\n", __func__);
302 &adap_to_d(adap)->i2c_adap, 307
308 return dvb_attach(mxl5005s_attach, adap->fe[0], &d->i2c_adap,
303 &ec168_mxl5003s_config) == NULL ? -ENODEV : 0; 309 &ec168_mxl5003s_config) == NULL ? -ENODEV : 0;
304} 310}
305 311
306static int ec168_streaming_ctrl(struct dvb_frontend *fe, int onoff) 312static int ec168_streaming_ctrl(struct dvb_frontend *fe, int onoff)
307{ 313{
314 struct dvb_usb_device *d = fe_to_d(fe);
308 struct ec168_req req = {STREAMING_CTRL, 0x7f01, 0x0202, 0, NULL}; 315 struct ec168_req req = {STREAMING_CTRL, 0x7f01, 0x0202, 0, NULL};
309 pr_debug("%s: onoff=%d\n", __func__, onoff); 316 dev_dbg(&d->udev->dev, "%s: onoff=%d\n", __func__, onoff);
317
310 if (onoff) 318 if (onoff)
311 req.index = 0x0102; 319 req.index = 0x0102;
312 return ec168_ctrl_msg(fe_to_d(fe), &req); 320 return ec168_ctrl_msg(d, &req);
313} 321}
314 322
315/* DVB USB Driver stuff */ 323/* DVB USB Driver stuff */