Re: [PATCH RFC 1/3] dvb_frontend: use Kernel dev_* logging

2012-08-12 Thread Mauro Carvalho Chehab
Em 09-08-2012 19:24, Antti Palosaari escreveu:
 Signed-off-by: Antti Palosaari cr...@iki.fi

That looks ok for me.

 ---
  drivers/media/dvb/dvb-core/dvb_frontend.c | 226 
 +++---
  1 file changed, 116 insertions(+), 110 deletions(-)
 
 diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c 
 b/drivers/media/dvb/dvb-core/dvb_frontend.c
 index 13cf4d2..4548fc9 100644
 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c
 +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
 @@ -66,8 +66,6 @@ MODULE_PARM_DESC(dvb_powerdown_on_sleep, 0: do not power 
 down, 1: turn LNB volt
  module_param(dvb_mfe_wait_time, int, 0644);
  MODULE_PARM_DESC(dvb_mfe_wait_time, Wait up to mfe_wait_time seconds on 
 open() for multi-frontend to become available (default:5 seconds));
  
 -#define dprintk if (dvb_frontend_debug) printk
 -
  #define FESTATE_IDLE 1
  #define FESTATE_RETUNE 2
  #define FESTATE_TUNING_FAST 4
 @@ -207,7 +205,7 @@ static void dvb_frontend_add_event(struct dvb_frontend 
 *fe, fe_status_t status)
   struct dvb_frontend_event *e;
   int wp;
  
 - dprintk (%s\n, __func__);
 + dev_dbg(fe-dvb-device, %s:\n, __func__);

Just one small issue that it might have... some of those core printk facilities
add a \n at the end. Can't remember if dev_*() are the ones that do it. If so,
you'll need to remove the \n from each line.

Regards,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 1/3] dvb_frontend: use Kernel dev_* logging

2012-08-09 Thread Antti Palosaari
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb/dvb-core/dvb_frontend.c | 226 +++---
 1 file changed, 116 insertions(+), 110 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c 
b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 13cf4d2..4548fc9 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -66,8 +66,6 @@ MODULE_PARM_DESC(dvb_powerdown_on_sleep, 0: do not power 
down, 1: turn LNB volt
 module_param(dvb_mfe_wait_time, int, 0644);
 MODULE_PARM_DESC(dvb_mfe_wait_time, Wait up to mfe_wait_time seconds on 
open() for multi-frontend to become available (default:5 seconds));
 
-#define dprintk if (dvb_frontend_debug) printk
-
 #define FESTATE_IDLE 1
 #define FESTATE_RETUNE 2
 #define FESTATE_TUNING_FAST 4
@@ -207,7 +205,7 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, 
fe_status_t status)
struct dvb_frontend_event *e;
int wp;
 
-   dprintk (%s\n, __func__);
+   dev_dbg(fe-dvb-device, %s:\n, __func__);
 
if ((status  FE_HAS_LOCK)  has_get_frontend(fe))
dtv_get_frontend(fe, fepriv-parameters_out);
@@ -237,7 +235,7 @@ static int dvb_frontend_get_event(struct dvb_frontend *fe,
struct dvb_frontend_private *fepriv = fe-frontend_priv;
struct dvb_fe_events *events = fepriv-events;
 
-   dprintk (%s\n, __func__);
+   dev_dbg(fe-dvb-device, %s:\n, __func__);
 
if (events-overflow) {
events-overflow = 0;
@@ -282,10 +280,9 @@ static void dvb_frontend_clear_events(struct dvb_frontend 
*fe)
 
 static void dvb_frontend_init(struct dvb_frontend *fe)
 {
-   dprintk (DVB: initialising adapter %i frontend %i (%s)...\n,
-fe-dvb-num,
-fe-id,
-fe-ops.info.name);
+   dev_dbg(fe-dvb-device,
+   %s: initialising adapter %i frontend %i (%s)...\n,
+   __func__, fe-dvb-num, fe-id, fe-ops.info.name);
 
if (fe-ops.init)
fe-ops.init(fe);
@@ -319,8 +316,9 @@ EXPORT_SYMBOL(dvb_frontend_retune);
 static void dvb_frontend_swzigzag_update_delay(struct dvb_frontend_private 
*fepriv, int locked)
 {
int q2;
+   struct dvb_frontend *fe = fepriv-dvbdev-priv;
 
-   dprintk (%s\n, __func__);
+   dev_dbg(fe-dvb-device, %s:\n, __func__);
 
if (locked)
(fepriv-quality) = (fepriv-quality * 220 + 36*256) / 256;
@@ -412,10 +410,11 @@ static int dvb_frontend_swzigzag_autotune(struct 
dvb_frontend *fe, int check_wra
return 1;
}
 
-   dprintk(%s: drift:%i inversion:%i auto_step:%i 
-   auto_sub_step:%i started_auto_step:%i\n,
-   __func__, fepriv-lnb_drift, fepriv-inversion,
-   fepriv-auto_step, fepriv-auto_sub_step, 
fepriv-started_auto_step);
+   dev_dbg(fe-dvb-device, %s: drift:%i inversion:%i auto_step:%i  \
+   auto_sub_step:%i started_auto_step:%i\n,
+   __func__, fepriv-lnb_drift, fepriv-inversion,
+   fepriv-auto_step, fepriv-auto_sub_step,
+   fepriv-started_auto_step);
 
/* set the frontend itself */
c-frequency += fepriv-lnb_drift;
@@ -614,7 +613,7 @@ static int dvb_frontend_thread(void *data)
 
bool re_tune = false;
 
-   dprintk(%s\n, __func__);
+   dev_dbg(fe-dvb-device, %s:\n, __func__);
 
fepriv-check_wrapped = 0;
fepriv-quality = 0;
@@ -660,10 +659,10 @@ restart:
algo = fe-ops.get_frontend_algo(fe);
switch (algo) {
case DVBFE_ALGO_HW:
-   dprintk(%s: Frontend ALGO = DVBFE_ALGO_HW\n, 
__func__);
+   dev_dbg(fe-dvb-device, %s: Frontend ALGO = 
DVBFE_ALGO_HW\n, __func__);
 
if (fepriv-state  FESTATE_RETUNE) {
-   dprintk(%s: Retune requested, 
FESTATE_RETUNE\n, __func__);
+   dev_dbg(fe-dvb-device, %s: Retune 
requested, FESTATE_RETUNE\n, __func__);
re_tune = true;
fepriv-state = FESTATE_TUNED;
} else {
@@ -674,19 +673,19 @@ restart:
fe-ops.tune(fe, re_tune, 
fepriv-tune_mode_flags, fepriv-delay, s);
 
if (s != fepriv-status  
!(fepriv-tune_mode_flags  FE_TUNE_MODE_ONESHOT)) {
-   dprintk(%s: state changed, adding 
current state\n, __func__);
+   dev_dbg(fe-dvb-device, %s: state 
changed, adding current state\n, __func__);
dvb_frontend_add_event(fe, s);
fepriv-status = s;
}