diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2012-06-18 14:05:34 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-18 17:13:06 -0700 |
commit | f41ad6675f2d5705a0fc1e210af8eb4a27dbacb4 (patch) | |
tree | 3d4eba82cadb7f74c3d6528452e7396e487c99c5 /drivers/staging/comedi/drivers/serial2002.c | |
parent | 4ea418b8b2fa8a70d0fcc8231b65e67b3a72984b (diff) |
staging: comedi: change device used in dev_...() calls
A previous set of patches by Ravishankar Karkala Mallikarjunayya
replaced a load of printk() calls with dev_info(), dev_err(), etc.
Unfortunately, these used the 'struct device *hw_dev' member of 'struct
comedi_device') as the first parameter of these dev_...() calls, but
that pointer is usually NULL, so the kernel log messages come out a bit
wrong (they contain the phrase "(NULL device *)").
Use the 'struct device *class_dev' member of 'struct comedi_device'
instead for these dev_...() calls. It will be non-NULL and somewhat
meaningful to users. It's also consistent with those comedi drivers
that already use the class_dev member in their dev_...() calls.
Some of the messages included the format "comedi%d" with the minor
device number used for the "%d". This is now redundant as it will be
the same as the dev_name() part of the kernel log message produced by
the dev_...() calls.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/serial2002.c')
-rw-r--r-- | drivers/staging/comedi/drivers/serial2002.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c index e62297380786..c18314be8c82 100644 --- a/drivers/staging/comedi/drivers/serial2002.c +++ b/drivers/staging/comedi/drivers/serial2002.c @@ -782,7 +782,7 @@ static int serial2002_attach(struct comedi_device *dev, struct comedi_subdevice *s; int ret; - dev_dbg(dev->hw_dev, "comedi%d: attached\n", dev->minor); + dev_dbg(dev->class_dev, "serial2002: attach\n"); dev->board_name = board->name; if (alloc_private(dev, sizeof(struct serial2002_private)) < 0) return -ENOMEM; @@ -790,7 +790,7 @@ static int serial2002_attach(struct comedi_device *dev, dev->close = serial_2002_close; devpriv->port = it->options[0]; devpriv->speed = it->options[1]; - dev_dbg(dev->hw_dev, "/dev/ttyS%d @ %d\n", devpriv->port, + dev_dbg(dev->class_dev, "/dev/ttyS%d @ %d\n", devpriv->port, devpriv->speed); ret = comedi_alloc_subdevices(dev, 5); |