Skip to contentSkip to conversation

Staging: dgnc: Replace printk() with dev_info()

PATCH Superseded Cristina Opriceana 2 participants 2 messages Feb 27, 2015 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: dgnc: Replace printk() with dev_info()

This patch replaces printk() with dev_info() in order to avoid the suggestion of using a more specific function.
Warning found by checkpatch.pl

---
 drivers/staging/dgnc/dgnc_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +2 -2
index ace2af6..cd349cd 100644
@@ -364,7 +364,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
 
 		spin_lock_irqsave(&dgnc_global_lock, flags);
 		brd->msgbuf = NULL;
-		printk("%s", brd->msgbuf_head);
+		dev_info(&brd->pdev->dev, "dgnc : %s\n", brd->msgbuf_head);
 		kfree(brd->msgbuf_head);
 		brd->msgbuf_head = NULL;
 		spin_unlock_irqrestore(&dgnc_global_lock, flags);
@@ -612,7 +612,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 
 	spin_lock_irqsave(&dgnc_global_lock, flags);
 	brd->msgbuf = NULL;
-	printk("%s", brd->msgbuf_head);
+	dev_info(&brd->pdev->dev, "dgnc : %s\n", brd->msgbuf_head);
 	kfree(brd->msgbuf_head);
 	brd->msgbuf_head = NULL;
 	spin_unlock_irqrestore(&dgnc_global_lock, flags);
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 14 lines · Cristina Opriceana

This patch replaces printk() with dev_info() in order to avoid the suggestion of using a more specific function.
Warning found by checkpatch.pl

---
 drivers/staging/dgnc/dgnc_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +0 -0
index ace2af6..cd349cd 100644

drivers/staging/dgnc/dgnc_driver.c static void dgnc_cleanup_board(struct dgnc_board *brd) · line 367

Quoted 5 lines
drivers/staging/dgnc/dgnc_driver.c +1 -1
@@ -364,7 +364,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
 
 		spin_lock_irqsave(&dgnc_global_lock, flags);
 		brd->msgbuf = NULL;
-		printk("%s", brd->msgbuf_head);
+		dev_info(&brd->pdev->dev, "dgnc : %s\n", brd->msgbuf_head);

If you use dev_info, there is no need for the "dgnc : " portion of the string, it will show up automatically.

And this really looks like debugging information, why not use dev_dbg() instead?

thanks,

greg k-h