Skip to contentSkip to conversation

Staging: dgnc: replace printk

PATCH In review Matteo Semenzato 2 participants 2 messages Mar 1, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: dgnc: replace printk

From: Matteo Semenzato <[email protected]>

This patch fixes the following warning:
Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

---
 drivers/staging/dgnc/dgnc_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/dgnc/dgnc_sysfs.c +2 -2
index 2fd34ca..0fa2388 100644
@@ -91,7 +91,7 @@ void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver)
 	rc |= driver_create_file(driverfs, &driver_attr_maxboards);
 	rc |= driver_create_file(driverfs, &driver_attr_pollrate);
 	if (rc)
-		printk(KERN_ERR "DGNC: sysfs driver_create_file failed!\n");
+		pr_err("DGNC: sysfs driver_create_file failed!\n");
 }
 
 
@@ -360,7 +360,7 @@ void dgnc_create_ports_sysfiles(struct dgnc_board *bd)
 	rc |= device_create_file(&(bd->pdev->dev), &dev_attr_vpd);
 	rc |= device_create_file(&(bd->pdev->dev), &dev_attr_serial_number);
 	if (rc)
-		printk(KERN_ERR "DGNC: sysfs device_create_file failed!\n");
+		pr_err("DGNC: sysfs device_create_file failed!\n");
 }
 
 
Signature · 1 line
2.3.1
maintainer
#1 lore raw
Quoted 25 lines · Matteo Semenzato

From: Matteo Semenzato <[email protected]>

This patch fixes the following warning:
Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

---
 drivers/staging/dgnc/dgnc_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/dgnc/dgnc_sysfs.c +1 -1
index 2fd34ca..0fa2388 100644
@@ -91,7 +91,7 @@ void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver)
 	rc |= driver_create_file(driverfs, &driver_attr_maxboards);
 	rc |= driver_create_file(driverfs, &driver_attr_pollrate);
 	if (rc)
-		printk(KERN_ERR "DGNC: sysfs driver_create_file failed!\n");
+		pr_err("DGNC: sysfs driver_create_file failed!\n");
 }
 
 

drivers/staging/dgnc/dgnc_sysfs.c void dgnc_create_ports_sysfiles(struct dgnc_board *bd) · line 363

Quoted 5 lines
drivers/staging/dgnc/dgnc_sysfs.c +1 -1
@@ -360,7 +360,7 @@ void dgnc_create_ports_sysfiles(struct dgnc_board *bd)
 	rc |= device_create_file(&(bd->pdev->dev), &dev_attr_vpd);
 	rc |= device_create_file(&(bd->pdev->dev), &dev_attr_serial_number);
 	if (rc)
-		printk(KERN_ERR "DGNC: sysfs device_create_file failed!\n");
+		pr_err("DGNC: sysfs device_create_file failed!\n");

Why can't you use dev_err() here?