Skip to contentSkip to conversation

staging: dgnc_sysfs: Replace printk(KERN_ERR ) with pr_err()

PATCH In review Ioana Ciornei 2 participants 2 messages Mar 30, 2015 – Apr 1, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: dgnc_sysfs: Replace printk(KERN_ERR ) with pr_err()

Fix the following checkpatch warning:
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/dgnc/dgnc_sysfs.c +1 -1
index 2df889e..65551d1 100644
@@ -75,7 +75,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");
 }
 
 
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 15 lines · Ioana Ciornei

Fix the following checkpatch warning:
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/dgnc/dgnc_sysfs.c +0 -0
index 2df889e..65551d1 100644

drivers/staging/dgnc/dgnc_sysfs.c void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver) · line 78

Quoted 5 lines
drivers/staging/dgnc/dgnc_sysfs.c +1 -1
@@ -75,7 +75,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");

You have access to a struct device, so please use it here and use dev_err().

Actually, no, what a mess, a driver shouldn't be creating files. Ugh, I'll take this, but this really needs to be fixed up and just removed...

thanks,

greg k-h