From: Greg Kroah-Hartman <greg@kroah.com>
To: YAMANE Toshiaki <yamanetoshi@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>,
Frank Mori Hess <fmhess@users.sourceforge.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c
Date: Mon, 22 Oct 2012 12:52:50 -0700 [thread overview]
Message-ID: <20121022195250.GD8567@kroah.com> (raw)
In-Reply-To: <1349871659-4511-1-git-send-email-yamanetoshi@gmail.com>
On Wed, Oct 10, 2012 at 09:20:59PM +0900, YAMANE Toshiaki wrote:
> fixed below checkpatch warning.
> - WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ...
>
> and added pr_fmt.
>
> Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
> ---
> drivers/staging/comedi/drivers/gsc_hpdi.c | 31 +++++++++++++++--------------
> 1 file changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c
> index abff660..30a27fd 100644
> --- a/drivers/staging/comedi/drivers/gsc_hpdi.c
> +++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
> @@ -45,6 +45,8 @@ support could be added to this driver.
>
> */
>
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> #include <linux/interrupt.h>
> #include "../comedidev.h"
> #include <linux/delay.h>
> @@ -107,8 +109,7 @@ enum hpdi_registers {
> int command_channel_valid(unsigned int channel)
> {
> if (channel == 0 || channel > 6) {
> - printk(KERN_WARNING
> - "gsc_hpdi: bug! invalid cable command channel\n");
> + pr_warn("bug! invalid cable command channel\n");
> return 0;
> }
> return 1;
> @@ -553,7 +554,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
> int i;
> int retval;
>
> - printk(KERN_WARNING "comedi%d: gsc_hpdi\n", dev->minor);
> + dev_warn(dev->class_dev, "gsc_hpdi\n");
What is this warning about?
>
> if (alloc_private(dev, sizeof(struct hpdi_private)) < 0)
> return -ENOMEM;
> @@ -582,17 +583,17 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
> } while (pcidev != NULL);
> }
> if (dev->board_ptr == NULL) {
> - printk(KERN_WARNING "gsc_hpdi: no hpdi card found\n");
> + dev_warn(dev->class_dev, "no hpdi card found\n");
> return -EIO;
> }
>
> - printk(KERN_WARNING
> - "gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
> - pcidev->bus->number, PCI_SLOT(pcidev->devfn));
> + dev_warn(dev->class_dev,
> + "found %s on bus %i, slot %i\n", board(dev)->name,
> + pcidev->bus->number, PCI_SLOT(pcidev->devfn));
>
> if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
> - printk(KERN_WARNING
> - " failed enable PCI device and request regions\n");
> + dev_warn(dev->class_dev,
> + " failed enable PCI device and request regions\n");
> return -EIO;
> }
> pci_set_master(pcidev);
> @@ -613,7 +614,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
> ioremap(priv(dev)->hpdi_phys_iobase,
> pci_resource_len(pcidev, HPDI_BADDRINDEX));
> if (!priv(dev)->plx9080_iobase || !priv(dev)->hpdi_iobase) {
> - printk(KERN_WARNING " failed to remap io memory\n");
> + dev_warn(dev->class_dev, "failed to remap io memory\n");
> return -ENOMEM;
> }
>
> @@ -625,13 +626,13 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
> /* get irq */
> if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
> dev->driver->driver_name, dev)) {
> - printk(KERN_WARNING
> - " unable to allocate irq %u\n", pcidev->irq);
> + dev_warn(dev->class_dev,
> + "unable to allocate irq %u\n", pcidev->irq);
> return -EINVAL;
> }
> dev->irq = pcidev->irq;
>
> - printk(KERN_WARNING " irq %u\n", dev->irq);
> + dev_warn(dev->class_dev, "irq %u\n", dev->irq);
Again a warning? Shouldn't most of these be debugging lines instead?
greg k-h
next prev parent reply other threads:[~2012-10-22 19:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-10 12:20 [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c YAMANE Toshiaki
2012-10-22 19:52 ` Greg Kroah-Hartman [this message]
2012-10-25 2:23 ` [PATCH v2] " YAMANE Toshiaki
2012-10-25 2:43 ` Greg Kroah-Hartman
2012-10-25 2:46 ` Toshiaki Yamane
2012-10-25 11:12 ` [PATCH v3] " YAMANE Toshiaki
2012-10-25 19:24 ` Greg Kroah-Hartman
2012-10-26 0:21 ` [PATCH v4] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hpdi.c YAMANE Toshiaki
2012-10-25 10:50 ` [PATCH] staging/comedi: Use pr_ or dev_ printks in drivers/gsc_hdpi.c Toshiaki Yamane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121022195250.GD8567@kroah.com \
--to=greg@kroah.com \
--cc=abbotti@mev.co.uk \
--cc=fmhess@users.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=yamanetoshi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.