staging: media: lirc: lirc_sir.c: use pr_debug and dev_dbg instead of dprintk
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Sun, 26 Oct 2014 17:46:00 +0000 (19:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 07:36:36 +0000 (15:36 +0800)
This patch removes the custom printk macro dprintk and replaces most of
the calls made to it by dev_dbg. pr_debug was used when the calling
function did not provide the appropiate device variable.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/lirc/lirc_sir.c

index 2ee55eaf2a53da8aa66db031a0c158a074d15b4f..4af82e6b2d77dc8d43358df0799c87e81f09ce50 100644 (file)
@@ -140,12 +140,6 @@ static int rx_buf[RBUF_LEN];
 static unsigned int rx_tail, rx_head;
 
 static bool debug;
-#define dprintk(fmt, args...)                                          \
-       do {                                                            \
-               if (debug)                                              \
-                       printk(KERN_DEBUG LIRC_DRIVER_NAME ": "         \
-                               fmt, ## args);                          \
-       } while (0)
 
 /* SECTION: Prototypes */
 
@@ -322,7 +316,7 @@ static void add_read_queue(int flag, unsigned long val)
        unsigned int new_rx_tail;
        int newval;
 
-       dprintk("add flag %d with val %lu\n", flag, val);
+       pr_debug("add flag %d with val %lu\n", flag, val);
 
        newval = val & PULSE_MASK;
 
@@ -342,7 +336,7 @@ static void add_read_queue(int flag, unsigned long val)
        }
        new_rx_tail = (rx_tail + 1) & (RBUF_LEN - 1);
        if (new_rx_tail == rx_head) {
-               dprintk("Buffer overrun.\n");
+               pr_debug("Buffer overrun.\n");
                return;
        }
        rx_buf[rx_tail] = newval;
@@ -439,7 +433,8 @@ static void sir_timeout(unsigned long data)
                outb(UART_FCR_CLEAR_RCVR, io + UART_FCR);
                /* determine 'virtual' pulse end: */
                pulse_end = delta(&last_tv, &last_intr_tv);
-               dprintk("timeout add %d for %lu usec\n", last_value, pulse_end);
+               dev_dbg(driver.dev, "timeout add %d for %lu usec\n",
+                                   last_value, pulse_end);
                add_read_queue(last_value, pulse_end);
                last_value = 0;
                last_tv = last_intr_tv;
@@ -479,14 +474,15 @@ static irqreturn_t sir_interrupt(int irq, void *dev_id)
                                do_gettimeofday(&curr_tv);
                                deltv = delta(&last_tv, &curr_tv);
                                deltintrtv = delta(&last_intr_tv, &curr_tv);
-                               dprintk("t %lu, d %d\n", deltintrtv, (int)data);
+                               dev_dbg(driver.dev, "t %lu, d %d\n",
+                                                   deltintrtv, (int)data);
                                /*
                                 * if nothing came in last X cycles,
                                 * it was gap
                                 */
                                if (deltintrtv > TIME_CONST * threshold) {
                                        if (last_value) {
-                                               dprintk("GAP\n");
+                                               dev_dbg(driver.dev, "GAP\n");
                                                /* simulate signal change */
                                                add_read_queue(last_value,
                                                               deltv -