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

login
register
mail settings
Submitter Jingoo Han
Date Dec. 26, 2013, 3:30 a.m.
Message ID <009c01cf01ea$e48f10f0$adad32d0$%han@samsung.com>
Download mbox | patch
Permalink /patch/305185/
State Accepted
Commit 1295f97002bd8c4fd7d927607dcd4657d4727d08
Headers show

Comments

Jingoo Han - Dec. 26, 2013, 3:30 a.m.
Use dev_err() instead of printk() to provide a better message
to userspace.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
Change since v1
- Remove the site-specific OOM messages.

 drivers/mtd/nand/atmel_nand.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Wu, Josh - Dec. 27, 2013, 6:56 a.m.
On 12/26/2013 11:30 AM, Jingoo Han wrote:
> Use dev_err() instead of printk() to provide a better message
> to userspace.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Josh Wu <josh.wu@atmel.com>

Best Regards,
Josh Wu
> ---
> Change since v1
> - Remove the site-specific OOM messages.
>
>   drivers/mtd/nand/atmel_nand.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
> index e633c44..c36e9b8 100644
> --- a/drivers/mtd/nand/atmel_nand.c
> +++ b/drivers/mtd/nand/atmel_nand.c
> @@ -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;
>   	}
>

Patch

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index e633c44..c36e9b8 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -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;
 	}