All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: orion_nand: convert printk to dev_*
@ 2013-06-09 21:16 Andy Shevchenko
  2013-06-09 22:18 ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2013-06-09 21:16 UTC (permalink / raw)
  To: linux-mtd, Emil Goode, artem.bityutskiy, Dan Carpenter; +Cc: Andy Shevchenko

It's better to use actual device name as a prefix in error messages.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/mtd/nand/orion_nand.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 8fbd002..ba38853 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, "failed to allocate device structure.\n");
 		ret = -ENOMEM;
 		goto no_res;
 	}
@@ -101,7 +101,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;
 	}
@@ -110,7 +110,8 @@ 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,
+				"failed to allocate board structure.\n");
 			ret = -ENOMEM;
 			goto no_res;
 		}
-- 
1.8.3.101.g727a46b

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mtd: orion_nand: convert printk to dev_*
  2013-06-09 21:16 [PATCH] mtd: orion_nand: convert printk to dev_* Andy Shevchenko
@ 2013-06-09 22:18 ` Dan Carpenter
  2013-06-09 22:31   ` Andy Shevchenko
  2013-06-09 22:39   ` Emil Goode
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2013-06-09 22:18 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: artem.bityutskiy, Emil Goode, linux-mtd

On Mon, Jun 10, 2013 at 12:16:54AM +0300, Andy Shevchenko wrote:
> It's better to use actual device name as a prefix in error messages.
> 

Gar...

This doesn't apply on top of Emil's patch.  Emil's patch was first
so it should go in first.  Also Emil's patch was a bugfix so it is
more important than this printk cleanup patch.

Really, the kzalloc error messages should just be deleted.  They are
cargo cult error messages as in "we need an error message because
we are copy and pasting from other code without thinking."  Kzalloc
already has far better messages built in.

Ah well...

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mtd: orion_nand: convert printk to dev_*
  2013-06-09 22:18 ` Dan Carpenter
@ 2013-06-09 22:31   ` Andy Shevchenko
  2013-06-09 23:34     ` Emil Goode
  2013-06-09 22:39   ` Emil Goode
  1 sibling, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2013-06-09 22:31 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: artem.bityutskiy, Emil Goode, linux-mtd

On Mon, Jun 10, 2013 at 1:18 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Mon, Jun 10, 2013 at 12:16:54AM +0300, Andy Shevchenko wrote:
>> It's better to use actual device name as a prefix in error messages.
>>
>
> Gar...
>
> This doesn't apply on top of Emil's patch.  Emil's patch was first
> so it should go in first.  Also Emil's patch was a bugfix so it is
> more important than this printk cleanup patch.

Which tree has that patch incorporated? I'm okay to rebase it against that tree.
Current version was done against recent linux-next.

--
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mtd: orion_nand: convert printk to dev_*
  2013-06-09 22:18 ` Dan Carpenter
  2013-06-09 22:31   ` Andy Shevchenko
@ 2013-06-09 22:39   ` Emil Goode
  1 sibling, 0 replies; 5+ messages in thread
From: Emil Goode @ 2013-06-09 22:39 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: artem.bityutskiy, Andy Shevchenko, linux-mtd

Hello Dan,

Thank you for pointing this out, I was going to send a second version
and fix that typo anyway so I will send a patch that applies on top
of Andy's patch and also remove that error message for kzalloc.

Best regards,

Emil

On Mon, Jun 10, 2013 at 01:18:08AM +0300, Dan Carpenter wrote:
> On Mon, Jun 10, 2013 at 12:16:54AM +0300, Andy Shevchenko wrote:
> > It's better to use actual device name as a prefix in error messages.
> > 
> 
> Gar...
> 
> This doesn't apply on top of Emil's patch.  Emil's patch was first
> so it should go in first.  Also Emil's patch was a bugfix so it is
> more important than this printk cleanup patch.
> 
> Really, the kzalloc error messages should just be deleted.  They are
> cargo cult error messages as in "we need an error message because
> we are copy and pasting from other code without thinking."  Kzalloc
> already has far better messages built in.
> 
> Ah well...
> 
> regards,
> dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mtd: orion_nand: convert printk to dev_*
  2013-06-09 22:31   ` Andy Shevchenko
@ 2013-06-09 23:34     ` Emil Goode
  0 siblings, 0 replies; 5+ messages in thread
From: Emil Goode @ 2013-06-09 23:34 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: artem.bityutskiy, linux-mtd, Dan Carpenter

Hello Andy,

Thanks for the hint about converting to dev*. But I agree with Dan that error
messages for kzalloc calls are a bit pointless and after removing them all the
dev* calls are gone. So I will send a second version that fixes the typo and
removes the error messages for kzalloc. If you have any objections let me know. 

Best regards,

Emil

On Mon, Jun 10, 2013 at 01:31:27AM +0300, Andy Shevchenko wrote:
> On Mon, Jun 10, 2013 at 1:18 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > On Mon, Jun 10, 2013 at 12:16:54AM +0300, Andy Shevchenko wrote:
> >> It's better to use actual device name as a prefix in error messages.
> >>
> >
> > Gar...
> >
> > This doesn't apply on top of Emil's patch.  Emil's patch was first
> > so it should go in first.  Also Emil's patch was a bugfix so it is
> > more important than this printk cleanup patch.
> 
> Which tree has that patch incorporated? I'm okay to rebase it against that tree.
> Current version was done against recent linux-next.
> 
> --
> With Best Regards,
> Andy Shevchenko

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-09 23:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-09 21:16 [PATCH] mtd: orion_nand: convert printk to dev_* Andy Shevchenko
2013-06-09 22:18 ` Dan Carpenter
2013-06-09 22:31   ` Andy Shevchenko
2013-06-09 23:34     ` Emil Goode
2013-06-09 22:39   ` Emil Goode

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.