diff options
author | Antti Palosaari <crope@iki.fi> | 2012-06-12 19:40:21 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-04 06:56:31 -0400 |
commit | ce6ea9a9424b5c511ea6d7b86081f01fa53d02b4 (patch) | |
tree | b55cccc7e3674d582e14814c907d20e442f3b985 | |
parent | 3eee04722fa18f8e1db1730b2e508b6eb6f5336b (diff) |
[media] ec168: switch Kernel pr_* logging
Change logging.
Some minor text and error number changes.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/dvb-usb/ec168.c | 38 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/ec168.h | 34 |
2 files changed, 25 insertions, 47 deletions
diff --git a/drivers/media/dvb/dvb-usb/ec168.c b/drivers/media/dvb/dvb-usb/ec168.c index 864195a56af..717c66a4bdd 100644 --- a/drivers/media/dvb/dvb-usb/ec168.c +++ b/drivers/media/dvb/dvb-usb/ec168.c | |||
@@ -23,10 +23,6 @@ | |||
23 | #include "ec100.h" | 23 | #include "ec100.h" |
24 | #include "mxl5005s.h" | 24 | #include "mxl5005s.h" |
25 | 25 | ||
26 | /* debug */ | ||
27 | static int dvb_usb_ec168_debug; | ||
28 | module_param_named(debug, dvb_usb_ec168_debug, int, 0644); | ||
29 | MODULE_PARM_DESC(debug, "set debugging level" DVB_USB_DEBUG_STATUS); | ||
30 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 26 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
31 | 27 | ||
32 | static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req) | 28 | static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req) |
@@ -65,8 +61,8 @@ static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req) | |||
65 | request = DEMOD_RW; | 61 | request = DEMOD_RW; |
66 | break; | 62 | break; |
67 | default: | 63 | default: |
68 | err("unknown command:%02x", req->cmd); | 64 | pr_err("%s: unknown command=%02x\n", KBUILD_MODNAME, req->cmd); |
69 | ret = -EPERM; | 65 | ret = -EINVAL; |
70 | goto error; | 66 | goto error; |
71 | } | 67 | } |
72 | 68 | ||
@@ -91,7 +87,7 @@ static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req) | |||
91 | req->index, buf, req->size, EC168_USB_TIMEOUT); | 87 | req->index, buf, req->size, EC168_USB_TIMEOUT); |
92 | 88 | ||
93 | ec168_debug_dump(request, requesttype, req->value, req->index, buf, | 89 | ec168_debug_dump(request, requesttype, req->value, req->index, buf, |
94 | req->size, deb_xfer); | 90 | req->size); |
95 | 91 | ||
96 | if (ret < 0) | 92 | if (ret < 0) |
97 | goto err_dealloc; | 93 | goto err_dealloc; |
@@ -108,7 +104,7 @@ static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req) | |||
108 | err_dealloc: | 104 | err_dealloc: |
109 | kfree(buf); | 105 | kfree(buf); |
110 | error: | 106 | error: |
111 | deb_info("%s: failed:%d\n", __func__, ret); | 107 | pr_debug("%s: failed=%d\n", __func__, ret); |
112 | return ret; | 108 | return ret; |
113 | } | 109 | } |
114 | 110 | ||
@@ -140,8 +136,9 @@ static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
140 | ret = ec168_ctrl_msg(d, &req); | 136 | ret = ec168_ctrl_msg(d, &req); |
141 | i += 2; | 137 | i += 2; |
142 | } else { | 138 | } else { |
143 | err("I2C read not implemented"); | 139 | pr_err("%s: I2C read not implemented\n", |
144 | ret = -ENOSYS; | 140 | KBUILD_MODNAME); |
141 | ret = -EOPNOTSUPP; | ||
145 | i += 2; | 142 | i += 2; |
146 | } | 143 | } |
147 | } else { | 144 | } else { |
@@ -190,13 +187,13 @@ static int ec168_identify_state(struct dvb_usb_device *d) | |||
190 | int ret; | 187 | int ret; |
191 | u8 reply; | 188 | u8 reply; |
192 | struct ec168_req req = {GET_CONFIG, 0, 1, sizeof(reply), &reply}; | 189 | struct ec168_req req = {GET_CONFIG, 0, 1, sizeof(reply), &reply}; |
193 | deb_info("%s:\n", __func__); | 190 | pr_debug("%s:\n", __func__); |
194 | 191 | ||
195 | ret = ec168_ctrl_msg(d, &req); | 192 | ret = ec168_ctrl_msg(d, &req); |
196 | if (ret) | 193 | if (ret) |
197 | goto error; | 194 | goto error; |
198 | 195 | ||
199 | deb_info("%s: reply:%02x\n", __func__, reply); | 196 | pr_debug("%s: reply=%02x\n", __func__, reply); |
200 | 197 | ||
201 | if (reply == 0x01) | 198 | if (reply == 0x01) |
202 | ret = WARM; | 199 | ret = WARM; |
@@ -205,7 +202,7 @@ static int ec168_identify_state(struct dvb_usb_device *d) | |||
205 | 202 | ||
206 | return ret; | 203 | return ret; |
207 | error: | 204 | error: |
208 | deb_info("%s: failed:%d\n", __func__, ret); | 205 | pr_debug("%s: failed=%d\n", __func__, ret); |
209 | return ret; | 206 | return ret; |
210 | } | 207 | } |
211 | 208 | ||
@@ -215,7 +212,7 @@ static int ec168_download_firmware(struct dvb_usb_device *d, | |||
215 | int i, len, packets, remainder, ret; | 212 | int i, len, packets, remainder, ret; |
216 | u16 addr = 0x0000; /* firmware start address */ | 213 | u16 addr = 0x0000; /* firmware start address */ |
217 | struct ec168_req req = {DOWNLOAD_FIRMWARE, 0, 0, 0, NULL}; | 214 | struct ec168_req req = {DOWNLOAD_FIRMWARE, 0, 0, 0, NULL}; |
218 | deb_info("%s:\n", __func__); | 215 | pr_debug("%s:\n", __func__); |
219 | 216 | ||
220 | #define FW_PACKET_MAX_DATA 2048 | 217 | #define FW_PACKET_MAX_DATA 2048 |
221 | packets = fw->size / FW_PACKET_MAX_DATA; | 218 | packets = fw->size / FW_PACKET_MAX_DATA; |
@@ -232,7 +229,8 @@ static int ec168_download_firmware(struct dvb_usb_device *d, | |||
232 | 229 | ||
233 | ret = ec168_ctrl_msg(d, &req); | 230 | ret = ec168_ctrl_msg(d, &req); |
234 | if (ret) { | 231 | if (ret) { |
235 | err("firmware download failed:%d packet:%d", ret, i); | 232 | pr_err("%s: firmware download failed=%d packet=%d\n", |
233 | KBUILD_MODNAME, ret, i); | ||
236 | goto error; | 234 | goto error; |
237 | } | 235 | } |
238 | } | 236 | } |
@@ -264,7 +262,7 @@ static int ec168_download_firmware(struct dvb_usb_device *d, | |||
264 | 262 | ||
265 | return ret; | 263 | return ret; |
266 | error: | 264 | error: |
267 | deb_info("%s: failed:%d\n", __func__, ret); | 265 | pr_debug("%s: failed=%d\n", __func__, ret); |
268 | return ret; | 266 | return ret; |
269 | } | 267 | } |
270 | 268 | ||
@@ -274,7 +272,7 @@ static struct ec100_config ec168_ec100_config = { | |||
274 | 272 | ||
275 | static int ec168_ec100_frontend_attach(struct dvb_usb_adapter *adap) | 273 | static int ec168_ec100_frontend_attach(struct dvb_usb_adapter *adap) |
276 | { | 274 | { |
277 | deb_info("%s:\n", __func__); | 275 | pr_debug("%s:\n", __func__); |
278 | adap->fe[0] = dvb_attach(ec100_attach, &ec168_ec100_config, | 276 | adap->fe[0] = dvb_attach(ec100_attach, &ec168_ec100_config, |
279 | &adap->dev->i2c_adap); | 277 | &adap->dev->i2c_adap); |
280 | if (adap->fe[0] == NULL) | 278 | if (adap->fe[0] == NULL) |
@@ -302,7 +300,7 @@ static struct mxl5005s_config ec168_mxl5003s_config = { | |||
302 | 300 | ||
303 | static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) | 301 | static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) |
304 | { | 302 | { |
305 | deb_info("%s:\n", __func__); | 303 | pr_debug("%s:\n", __func__); |
306 | return dvb_attach(mxl5005s_attach, adap->fe[0], | 304 | return dvb_attach(mxl5005s_attach, adap->fe[0], |
307 | &adap->dev->i2c_adap, | 305 | &adap->dev->i2c_adap, |
308 | &ec168_mxl5003s_config) == NULL ? -ENODEV : 0; | 306 | &ec168_mxl5003s_config) == NULL ? -ENODEV : 0; |
@@ -311,7 +309,7 @@ static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) | |||
311 | static int ec168_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | 309 | static int ec168_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) |
312 | { | 310 | { |
313 | struct ec168_req req = {STREAMING_CTRL, 0x7f01, 0x0202, 0, NULL}; | 311 | struct ec168_req req = {STREAMING_CTRL, 0x7f01, 0x0202, 0, NULL}; |
314 | deb_info("%s: onoff:%d\n", __func__, onoff); | 312 | pr_debug("%s: onoff=%d\n", __func__, onoff); |
315 | if (onoff) | 313 | if (onoff) |
316 | req.index = 0x0102; | 314 | req.index = 0x0102; |
317 | return ec168_ctrl_msg(adap->dev, &req); | 315 | return ec168_ctrl_msg(adap->dev, &req); |
@@ -386,5 +384,5 @@ static struct usb_driver ec168_driver = { | |||
386 | module_usb_driver(ec168_driver); | 384 | module_usb_driver(ec168_driver); |
387 | 385 | ||
388 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); | 386 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); |
389 | MODULE_DESCRIPTION("E3C EC168 DVB-T USB2.0 driver"); | 387 | MODULE_DESCRIPTION("E3C EC168 driver"); |
390 | MODULE_LICENSE("GPL"); | 388 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/media/dvb/dvb-usb/ec168.h b/drivers/media/dvb/dvb-usb/ec168.h index b33267b0e5c..9181236f6eb 100644 --- a/drivers/media/dvb/dvb-usb/ec168.h +++ b/drivers/media/dvb/dvb-usb/ec168.h | |||
@@ -22,37 +22,17 @@ | |||
22 | #ifndef EC168_H | 22 | #ifndef EC168_H |
23 | #define EC168_H | 23 | #define EC168_H |
24 | 24 | ||
25 | #define DVB_USB_LOG_PREFIX "ec168" | ||
26 | #include "dvb_usb.h" | 25 | #include "dvb_usb.h" |
27 | 26 | ||
28 | #ifdef CONFIG_DVB_USB_DEBUG | 27 | #define ec168_debug_dump(r, t, v, i, b, l) { \ |
29 | #define dprintk(var, level, args...) \ | 28 | char *direction; \ |
30 | do { if ((var & level)) printk(args); } while (0) | ||
31 | #define DVB_USB_DEBUG_STATUS | ||
32 | #else | ||
33 | #define dprintk(args...) | ||
34 | #define debug_dump(b, l, func) | ||
35 | #define DVB_USB_DEBUG_STATUS " (debugging is not enabled)" | ||
36 | #endif | ||
37 | |||
38 | #define deb_info(args...) dprintk(dvb_usb_ec168_debug, 0x01, args) | ||
39 | #define deb_rc(args...) dprintk(dvb_usb_ec168_debug, 0x02, args) | ||
40 | #define deb_xfer(args...) dprintk(dvb_usb_ec168_debug, 0x04, args) | ||
41 | #define deb_reg(args...) dprintk(dvb_usb_ec168_debug, 0x08, args) | ||
42 | #define deb_i2c(args...) dprintk(dvb_usb_ec168_debug, 0x10, args) | ||
43 | #define deb_fw(args...) dprintk(dvb_usb_ec168_debug, 0x20, args) | ||
44 | |||
45 | #define ec168_debug_dump(r, t, v, i, b, l, func) { \ | ||
46 | int loop_; \ | ||
47 | func("%02x %02x %02x %02x %02x %02x %02x %02x", \ | ||
48 | t, r, v & 0xff, v >> 8, i & 0xff, i >> 8, l & 0xff, l >> 8); \ | ||
49 | if (t == (USB_TYPE_VENDOR | USB_DIR_OUT)) \ | 29 | if (t == (USB_TYPE_VENDOR | USB_DIR_OUT)) \ |
50 | func(" >>> "); \ | 30 | direction = ">>>"; \ |
51 | else \ | 31 | else \ |
52 | func(" <<< "); \ | 32 | direction = "<<<"; \ |
53 | for (loop_ = 0; loop_ < l; loop_++) \ | 33 | pr_debug("%s: %02x %02x %02x %02x %02x %02x %02x %02x %s\n", \ |
54 | func("%02x ", b[loop_]); \ | 34 | __func__, t, r, v & 0xff, v >> 8, i & 0xff, i >> 8, \ |
55 | func("\n");\ | 35 | l & 0xff, l >> 8, direction); \ |
56 | } | 36 | } |
57 | 37 | ||
58 | #define EC168_USB_TIMEOUT 1000 | 38 | #define EC168_USB_TIMEOUT 1000 |