Skip to contentSkip to conversation

regulators: max8998.c: use dev_err() instead of printk()

PATCH In review Thiago Farina 2 participants 2 messages Feb 23, 2013 – Mar 1, 2013 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 regulators: max8998.c: use dev_err() instead of printk()

Fixes the following checkpatch warning:

WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

---
 drivers/regulator/max8998.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/regulator/max8998.c +4 -3
index faeb7e8..a57a1b1 100644
@@ -666,7 +666,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
 		/* Check if SET1 is not equal to 0 */
 		if (!pdata->buck1_set1) {
 			dev_err(&pdev->dev,
-                                "MAX8998 SET1 GPIO defined as 0 !\n");
+				"MAX8998 SET1 GPIO defined as 0 !\n");
 			WARN_ON(!pdata->buck1_set1);
 			ret = -EIO;
 			goto err_out;
@@ -674,7 +674,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
 		/* Check if SET2 is not equal to 0 */
 		if (!pdata->buck1_set2) {
 			dev_err(&pdev->dev,
-                                "MAX8998 SET2 GPIO defined as 0 !\n");
+				"MAX8998 SET2 GPIO defined as 0 !\n");
 			WARN_ON(!pdata->buck1_set2);
 			ret = -EIO;
 			goto err_out;
@@ -740,7 +740,8 @@ static int max8998_pmic_probe(struct platform_device *pdev)
 	if (gpio_is_valid(pdata->buck2_set3)) {
 		/* Check if SET3 is not equal to 0 */
 		if (!pdata->buck2_set3) {
-			printk(KERN_ERR "MAX8998 SET3 GPIO defined as 0 !\n");
+			dev_err(&pdev->dev,
+				"MAX8998 SET3 GPIO defined as 0 !\n");
 			WARN_ON(!pdata->buck2_set3);
 			ret = -EIO;
 			goto err_out;
Signature · 1 line
1.8.1.151.g32238ae
#1 lore raw
Quoted 3 lines · Thiago Farina

Fixes the following checkpatch warning:

WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

This doesn't apply against current mainline, and...

drivers/regulator/max8998.c static int max8998_pmic_probe(struct platform_device *pdev) · line 672

Quoted 9 lines
drivers/regulator/max8998.c +1 -1
@@ -666,7 +666,7 @@ static int max8998_pmic_probe(struct platform_device *pdev)
 		/* Check if SET1 is not equal to 0 */
 		if (!pdata->buck1_set1) {
 			dev_err(&pdev->dev,
-                                "MAX8998 SET1 GPIO defined as 0 !\n");
+				"MAX8998 SET1 GPIO defined as 0 !\n");
 			WARN_ON(!pdata->buck1_set1);
 			ret = -EIO;
 			goto err_out;

...this (which is one of the failing hunks) is an indentation change which bears no relation to the changelog.

I've applied the final hunk which looks good but please be more careful in future.