Skip to contentSkip to conversation

pnp: Switch to dev_dbg

PATCH Applied Heiner Kallweit 2 participants 2 messages May 12, 2021 – May 17, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pnp: Switch to dev_dbg

Debug output in dmesg log may confuse users. Therefore let's restrict debug output to cases where DEBUG is defined or dynamic debug output is enabled for the respective code piece.

---
 drivers/pnp/core.c     | 5 ++---
 drivers/pnp/resource.c | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/pnp/core.c +2 -3
index ccdfbf397..4df5aa6a3 100644
@@ -215,9 +215,8 @@ int pnp_add_device(struct pnp_dev *dev)
 	for (id = dev->id; id; id = id->next)
 		len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id);
 
-	dev_printk(KERN_DEBUG, &dev->dev, "%s device, IDs%s (%s)\n",
-		   dev->protocol->name, buf,
-		   dev->active ? "active" : "disabled");
+	dev_dbg(&dev->dev, "%s device, IDs%s (%s)\n", dev->protocol->name, buf,
+		dev->active ? "active" : "disabled");
 	return 0;
 }
 
drivers/pnp/resource.c +1 -1
index 70d4ba957..2fa0f7d55 100644
@@ -540,7 +540,7 @@ struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq,
 	res->start = irq;
 	res->end = irq;
 
-	dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res);
+	dev_dbg(&dev->dev, "%pR\n", res);
 	return pnp_res;
 }
 
Signature · 1 line
2.31.1
maintainer Applied
#1 lore raw
Quoted 32 lines · Heiner Kallweit

Debug output in dmesg log may confuse users. Therefore let's restrict debug output to cases where DEBUG is defined or dynamic debug output is enabled for the respective code piece.

---
 drivers/pnp/core.c     | 5 ++---
 drivers/pnp/resource.c | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/pnp/core.c +2 -3
index ccdfbf397..4df5aa6a3 100644
@@ -215,9 +215,8 @@ int pnp_add_device(struct pnp_dev *dev)
        for (id = dev->id; id; id = id->next)
                len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id);
 
-       dev_printk(KERN_DEBUG, &dev->dev, "%s device, IDs%s (%s)\n",
-                  dev->protocol->name, buf,
-                  dev->active ? "active" : "disabled");
+       dev_dbg(&dev->dev, "%s device, IDs%s (%s)\n", dev->protocol->name, buf,
+               dev->active ? "active" : "disabled");
        return 0;
 }
 
drivers/pnp/resource.c +0 -0
index 70d4ba957..2fa0f7d55 100644

drivers/pnp/resource.c struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq,

Quoted 9 lines
drivers/pnp/resource.c +1 -2
@@ -540,7 +540,7 @@ struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq,
        res->start = irq;
        res->end = irq;
 
-       dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res);
+       dev_dbg(&dev->dev, "%pR\n", res);
        return pnp_res;
 }
 
--

Applied as 5.14 material with edits in the subject and changelog, thanks!