Replace all usages of IRQ_MSG with with dev_<level> without __func__
or __LINE__ or current->comm and current->pid. Remove the do {}
while(0) loop for the single statement macro. Drop IRQ_MSG from dbg.h.
Issue found by checkpatch.

Signed-off-by: Nishad Kamdar <nishadkam...@gmail.com>
---
 drivers/staging/mt7621-mmc/dbg.h | 12 -----------
 drivers/staging/mt7621-mmc/sd.c  | 36 ++++++++++++++++++++++++--------
 2 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/dbg.h b/drivers/staging/mt7621-mmc/dbg.h
index 8d2c16450ef5..5458dae5dc03 100644
--- a/drivers/staging/mt7621-mmc/dbg.h
+++ b/drivers/staging/mt7621-mmc/dbg.h
@@ -109,18 +109,6 @@ do { \
  *}
  */
 
-#if 1
-//defined CONFIG_MTK_MMC_CD_POLL
-#define IRQ_MSG(fmt, args...)
-#else
-/* PID in ISR in not corrent */
-#define IRQ_MSG(fmt, args...) \
-do { \
-       printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d>\n",     \
-              host->id,  ##args, __FUNCTION__, __LINE__);      \
-} while (0);
-#endif
-
 void msdc_debug_proc_init(void);
 
 #if 0 /* --- chhung */
diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index 327c1cd7fd04..5cb6bc36e78b 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -420,7 +420,9 @@ static void msdc_tasklet_card(struct work_struct *work)
                mmc_detect_change(host->mmc, msecs_to_jiffies(20));
        }
 
-       IRQ_MSG("card found<%s>", inserted ? "inserted" : "removed");
+       dev_err(mmc_dev(host->mmc),
+               "%d -> card found<%s>\n",
+               host->id, inserted ? "inserted" : "removed");
 #endif
 
        spin_unlock(&host->lock);
@@ -1858,14 +1860,17 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
        if (intsts & MSDC_INT_CDSC) {
                if (host->mmc->caps & MMC_CAP_NEEDS_POLL)
                        return IRQ_HANDLED;
-               IRQ_MSG("MSDC_INT_CDSC irq<0x%.8x>", intsts);
+               dev_err(mmc_dev(host->mmc),
+                       "%d -> MSDC_INT_CDSC irq<0x%.8x>\n", host->id, intsts);
                schedule_delayed_work(&host->card_delaywork, HZ);
                /* tuning when plug card ? */
        }
 
        /* sdio interrupt */
        if (intsts & MSDC_INT_SDIOIRQ) {
-               IRQ_MSG("XXX MSDC_INT_SDIOIRQ");  /* seems not sdio irq */
+               dev_err(mmc_dev(host->mmc),
+                       "%d -> XXX MSDC_INT_SDIOIRQ\n",
+                       host->id); /* seems not sdio irq */
                //mmc_signal_sdio_irq(host->mmc);
        }
 
@@ -1883,10 +1888,15 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
                        msdc_clr_int();
 
                        if (intsts & MSDC_INT_DATTMO) {
-                               IRQ_MSG("XXX CMD<%d> MSDC_INT_DATTMO", 
host->mrq->cmd->opcode);
+                               dev_err(mmc_dev(host->mmc),
+                                       "%d -> XXX CMD<%d> MSDC_INT_DATTMO\n",
+                                       host->id, host->mrq->cmd->opcode);
                                data->error = -ETIMEDOUT;
                        } else if (intsts & MSDC_INT_DATCRCERR) {
-                               IRQ_MSG("XXX CMD<%d> MSDC_INT_DATCRCERR, 
SDC_DCRC_STS<0x%x>", host->mrq->cmd->opcode, readl(host->base + SDC_DCRC_STS));
+                               dev_err(mmc_dev(host->mmc),
+                                       "%d -> XXX CMD<%d> MSDC_INT_DATCRCERR, 
SDC_DCRC_STS<0x%x>\n",
+                                       host->id, host->mrq->cmd->opcode,
+                                       readl(host->base + SDC_DCRC_STS);
                                data->error = -EIO;
                        }
 
@@ -1919,15 +1929,23 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
                        }
                } else if ((intsts & MSDC_INT_RSPCRCERR) || (intsts & 
MSDC_INT_ACMDCRCERR)) {
                        if (intsts & MSDC_INT_ACMDCRCERR)
-                               IRQ_MSG("XXX CMD<%d> MSDC_INT_ACMDCRCERR", 
cmd->opcode);
+                               dev_err(mmc_dev(host->mmc),
+                                       "%d -> XXX CMD<%d> 
MSDC_INT_ACMDCRCERR\n",
+                                       host->id, cmd->opcode);
                        else
-                               IRQ_MSG("XXX CMD<%d> MSDC_INT_RSPCRCERR", 
cmd->opcode);
+                               dev_err(mmc_dev(host->mmc),
+                                       "%d -> XXX CMD<%d> 
MSDC_INT_RSPCRCERR\n",
+                                       host->id, cmd->opcode);
                        cmd->error = -EIO;
                } else if ((intsts & MSDC_INT_CMDTMO) || (intsts & 
MSDC_INT_ACMDTMO)) {
                        if (intsts & MSDC_INT_ACMDTMO)
-                               IRQ_MSG("XXX CMD<%d> MSDC_INT_ACMDTMO", 
cmd->opcode);
+                               dev_err(mmc_dev(host->mmc),
+                                       "%d -> XXX CMD<%d> MSDC_INT_ACMDTMO\n",
+                                       host->id, cmd->opcode);
                        else
-                               IRQ_MSG("XXX CMD<%d> MSDC_INT_CMDTMO", 
cmd->opcode);
+                               dev_err(mmc_dev(host->mmc),
+                                       "%d -> XXX CMD<%d> MSDC_INT_CMDTMO\n",
+                                       host->id, cmd->opcode);
                        cmd->error = -ETIMEDOUT;
                        msdc_reset_hw(host);
                        msdc_clr_fifo(host);
-- 
2.17.1

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to