Skip to contentSkip to conversation

mtd: nan: use dev_err() instead of printk()

PATCH Superseded Jingoo Han 4 participants 8 messages Dec 26, 2013 – Jan 7, 2014

Subsystems (3)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

cover mtd: nan: use dev_err() instead of printk()

Use dev_err()/dev_warn() instead of printk() to provide a better message to userspace.

Change since v1
- Remove the site-specific OOM messages, per Ezequiel Garcia.

Jingoo Han (4)
mtd: atmel_nand: use dev_err() instead of printk()
mtd: fsmc_nand: use dev_warn() instead of printk()
mtd: orion_nand: use dev_err() instead of printk()
mtd: sharpsl: use dev_err() instead of printk()

---
 drivers/mtd/nand/atmel_nand.c |    4 ++--
 drivers/mtd/nand/fsmc_nand.c  |    8 ++++----
 drivers/mtd/nand/orion_nand.c |    2 +-
 drivers/mtd/nand/sharpsl.c    |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
author
#1 lore raw

PATCH v2 1/4 mtd: atmel_nand: use dev_err() instead of printk()

Use dev_err() instead of printk() to provide a better message to userspace.

---
Change since v1
- Remove the site-specific OOM messages.

 drivers/mtd/nand/atmel_nand.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/atmel_nand.c +2 -2
index e633c44..c36e9b8 100644
@@ -2060,14 +2060,14 @@ static int atmel_nand_probe(struct platform_device *pdev)
 		}
 
 		if (gpio_get_value(host->board.det_pin)) {
-			printk(KERN_INFO "No SmartMedia card inserted.\n");
+			dev_info(&pdev->dev, "No SmartMedia card inserted.\n");
 			res = -ENXIO;
 			goto err_no_card;
 		}
 	}
 
 	if (host->board.on_flash_bbt || on_flash_bbt) {
-		printk(KERN_INFO "atmel_nand: Use On Flash BBT\n");
+		dev_info(&pdev->dev, "Use On Flash BBT\n");
 		nand_chip->bbt_options |= NAND_BBT_USE_FLASH;
 	}
 
Signature · 1 line
1.7.10.4
Acked-by on v2 1/4
#2 lore raw

Re: [PATCH V2 1/4] mtd: atmel_nand: use dev_err() instead of printk()

Quoted 4 lines · Jingoo Han

Use dev_err() instead of printk() to provide a better message to userspace.

Best Regards,
Josh Wu

Quoted 28 lines

---
Change since v1
- Remove the site-specific OOM messages.

  drivers/mtd/nand/atmel_nand.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/atmel_nand.c +2 -2
index e633c44..c36e9b8 100644
@@ -2060,14 +2060,14 @@ static int atmel_nand_probe(struct platform_device *pdev)
  		}
 
  		if (gpio_get_value(host->board.det_pin)) {
-			printk(KERN_INFO "No SmartMedia card inserted.\n");
+			dev_info(&pdev->dev, "No SmartMedia card inserted.\n");
  			res = -ENXIO;
  			goto err_no_card;
  		}
  	}
 
  	if (host->board.on_flash_bbt || on_flash_bbt) {
-		printk(KERN_INFO "atmel_nand: Use On Flash BBT\n");
+		dev_info(&pdev->dev, "Use On Flash BBT\n");
  		nand_chip->bbt_options |= NAND_BBT_USE_FLASH;
  	}
 
author
#3 lore raw

PATCH v2 2/4 mtd: fsmc_nand: use dev_warn() instead of printk()

In reply to Jingoo Han

Use dev_warn() instead of printk() to provide a better message to userspace.

---
No changes since v1.

 drivers/mtd/nand/fsmc_nand.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mtd/nand/fsmc_nand.c +4 -4
index a5915f1..1550692 100644
@@ -1104,8 +1104,8 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 			host->ecc_place = &fsmc_ecc4_lp_place;
 			break;
 		default:
-			printk(KERN_WARNING "No oob scheme defined for "
-			       "oobsize %d\n", mtd->oobsize);
+			dev_warn(&pdev->dev, "No oob scheme defined for oobsize %d\n",
+				 mtd->oobsize);
 			BUG();
 		}
 	} else {
@@ -1120,8 +1120,8 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 			nand->ecc.layout = &fsmc_ecc1_128_layout;
 			break;
 		default:
-			printk(KERN_WARNING "No oob scheme defined for "
-			       "oobsize %d\n", mtd->oobsize);
+			dev_warn(&pdev->dev, "No oob scheme defined for oobsize %d\n",
+				 mtd->oobsize);
 			BUG();
 		}
 	}
Signature · 1 line
1.7.10.4
author
#5 lore raw

PATCH v2 3/4 mtd: orion_nand: use dev_err() instead of printk()

In reply to Jingoo Han

Use dev_err() instead of printk() to provide a better message to userspace.

---
Change since v1
- Remove the site-specific OOM messages.

 drivers/mtd/nand/orion_nand.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/orion_nand.c +1 -1
index a6a4a20..dd7fe81 100644
@@ -100,7 +100,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
 
 	io_base = ioremap(res->start, resource_size(res));
 	if (!io_base) {
-		printk(KERN_ERR "orion_nand: ioremap failed\n");
+		dev_err(&pdev->dev, "ioremap failed\n");
 		ret = -EIO;
 		goto no_res;
 	}
Signature · 1 line
1.7.10.4
author
#6 lore raw

PATCH v2 4/4 mtd: sharpsl: use dev_err() instead of printk()

In reply to Jingoo Han

Use dev_err() instead of printk() to provide a better message to userspace.

---
Change since v1
- Remove the site-specific OOM messages.

 drivers/mtd/nand/sharpsl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/sharpsl.c +1 -1
index 61a85ab..e81059b 100644
@@ -134,7 +134,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev)
 	/* map physical address */
 	sharpsl->io = ioremap(r->start, resource_size(r));
 	if (!sharpsl->io) {
-		printk("ioremap to access Sharp SL NAND chip failed\n");
+		dev_err(&pdev->dev, "ioremap to access Sharp SL NAND chip failed\n");
 		err = -EIO;
 		goto err_ioremap;
 	}
Signature · 1 line
1.7.10.4
#7 lore raw
In reply to Jingoo Han
Quoted 11 lines · Jingoo Han

Use dev_err()/dev_warn() instead of printk() to provide a better message to userspace.

Change since v1
- Remove the site-specific OOM messages, per Ezequiel Garcia.

Jingoo Han (4)
mtd: atmel_nand: use dev_err() instead of printk()
mtd: fsmc_nand: use dev_warn() instead of printk()
mtd: orion_nand: use dev_err() instead of printk()
mtd: sharpsl: use dev_err() instead of printk()

Pushed all 4 to l2-mtd.git. Thanks.

Brian