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

Jingoo Han jg1.han at samsung.com
Wed Dec 25 20:50:23 EST 2013


On Saturday, December 21, 2013 11:22 PM, Ezequiel Garcia wrote:
> 
> Hi Jingoo,
> 
> Thanks for the cleanup!
> 
> I have some extra requests :-)
> 
> On Fri, Dec 20, 2013 at 05:20:50PM +0900, Jingoo Han wrote:
> [..]
> > diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> > index a393a5b..7cd9aed 100644
> > --- a/drivers/mtd/nand/orion_nand.c
> > +++ b/drivers/mtd/nand/orion_nand.c
> > @@ -87,7 +87,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> >
> >  	nc = kzalloc(sizeof(struct nand_chip) + sizeof(struct mtd_info), GFP_KERNEL);
> >  	if (!nc) {
> > -		printk(KERN_ERR "orion_nand: failed to allocate device structure.\n");
> > +		dev_err(&pdev->dev, "orion_nand: failed to allocate device structure.\n");
> 
> Instead of this replacement, can you remove the error message entirely?
> It's redundant for a driver to print anything after an allocation error, since an
> out-of-memory condition will print quite enough information.
> 
> (Google for "Joe Perches OOM" and you'll find lots of patches removing this prints).

OK, I see.

I checked the patches about OOM from Joe Perches.
I will send another patch to remove OOM error message,
instead of this patch. Thank you for your comment.

Best regards,
Jingoo Han

> 
> > @@ -110,7 +110,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> >  		board = devm_kzalloc(&pdev->dev, sizeof(struct orion_nand_data),
> >  					GFP_KERNEL);
> >  		if (!board) {
> > -			printk(KERN_ERR "orion_nand: failed to allocate board structure.\n");
> > +			dev_err(&pdev->dev, "orion_nand: failed to allocate board structure.\n");
> 
> Ditto.
> 
> Thanks!
> --
> Ezequiel García, Free Electrons
> Embedded Linux, Kernel and Android Engineering
> http://free-electrons.com




More information about the linux-mtd mailing list