From c96bf1d6a49f0b0d38d668195ee34de52693fb87 Mon Sep 17 00:00:00 2001 From: Aya Mahfouz Date: Sun, 26 Oct 2014 19:46:00 +0200 Subject: [PATCH] staging: media: lirc: lirc_sir.c: use pr_debug and dev_dbg instead of dprintk 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/lirc/lirc_sir.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/staging/media/lirc/lirc_sir.c b/drivers/staging/media/lirc/lirc_sir.c index 2ee55eaf2a53..4af82e6b2d77 100644 --- a/drivers/staging/media/lirc/lirc_sir.c +++ b/drivers/staging/media/lirc/lirc_sir.c @@ -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 - -- 2.30.2