Commit fdb2a66f authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: comedi_bond: remove private printk macros

Remove the macros LOG_MSG, DEBUG, WARNING, and ERROR. Convert
the printk's into dev_printk format.

The DEBUG macro is not being used in the file so the module
parameter 'debug' can also be removed.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a62a1764
...@@ -65,20 +65,6 @@ Configuration Options: ...@@ -65,20 +65,6 @@ Configuration Options:
# define STR(x) STR1(x) # define STR(x) STR1(x)
#endif #endif
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "If true, print extra cryptic debugging output useful"
"only to developers.");
#define LOG_MSG(x...) printk(KERN_INFO MODULE_NAME": "x)
#define DEBUG(x...) \
do { \
if (debug) \
printk(KERN_DEBUG MODULE_NAME": DEBUG: "x); \
} while (0)
#define WARNING(x...) printk(KERN_WARNING MODULE_NAME ": WARNING: "x)
#define ERROR(x...) printk(KERN_ERR MODULE_NAME ": INTERNAL ERROR: "x)
struct BondedDevice { struct BondedDevice {
struct comedi_device *dev; struct comedi_device *dev;
unsigned minor; unsigned minor;
...@@ -228,15 +214,18 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -228,15 +214,18 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
struct BondedDevice *bdev = NULL; struct BondedDevice *bdev = NULL;
if (minor < 0 || minor >= COMEDI_NUM_BOARD_MINORS) { if (minor < 0 || minor >= COMEDI_NUM_BOARD_MINORS) {
ERROR("Minor %d is invalid!\n", minor); dev_err(dev->class_dev,
"Minor %d is invalid!\n", minor);
return 0; return 0;
} }
if (minor == dev->minor) { if (minor == dev->minor) {
ERROR("Cannot bond this driver to itself!\n"); dev_err(dev->class_dev,
"Cannot bond this driver to itself!\n");
return 0; return 0;
} }
if (devs_opened[minor]) { if (devs_opened[minor]) {
ERROR("Minor %d specified more than once!\n", minor); dev_err(dev->class_dev,
"Minor %d specified more than once!\n", minor);
return 0; return 0;
} }
...@@ -246,7 +235,8 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -246,7 +235,8 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
d = devs_opened[minor] = comedi_open(file); d = devs_opened[minor] = comedi_open(file);
if (!d) { if (!d) {
ERROR("Minor %u could not be opened\n", minor); dev_err(dev->class_dev,
"Minor %u could not be opened\n", minor);
return 0; return 0;
} }
...@@ -255,14 +245,14 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -255,14 +245,14 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
sdev + 1)) > -1) { sdev + 1)) > -1) {
nchans = comedi_get_n_channels(d, sdev); nchans = comedi_get_n_channels(d, sdev);
if (nchans <= 0) { if (nchans <= 0) {
ERROR("comedi_get_n_channels() returned %d " dev_err(dev->class_dev,
"on minor %u subdev %d!\n", "comedi_get_n_channels() returned %d on minor %u subdev %d!\n",
nchans, minor, sdev); nchans, minor, sdev);
return 0; return 0;
} }
bdev = kmalloc(sizeof(*bdev), GFP_KERNEL); bdev = kmalloc(sizeof(*bdev), GFP_KERNEL);
if (!bdev) { if (!bdev) {
ERROR("Out of memory.\n"); dev_err(dev->class_dev, "Out of memory\n");
return 0; return 0;
} }
bdev->dev = d; bdev->dev = d;
...@@ -285,8 +275,8 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -285,8 +275,8 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
Realloc(devpriv->devs, Realloc(devpriv->devs,
++devpriv->ndevs * sizeof(bdev), tmp); ++devpriv->ndevs * sizeof(bdev), tmp);
if (!devpriv->devs) { if (!devpriv->devs) {
ERROR("Could not allocate memory. " dev_err(dev->class_dev,
"Out of memory?"); "Could not allocate memory. Out of memory?\n");
return 0; return 0;
} }
...@@ -306,7 +296,7 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -306,7 +296,7 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
} }
if (!devpriv->nchans) { if (!devpriv->nchans) {
ERROR("No channels found!\n"); dev_err(dev->class_dev, "No channels found!\n");
return 0; return 0;
} }
...@@ -320,8 +310,6 @@ static int bonding_attach(struct comedi_device *dev, ...@@ -320,8 +310,6 @@ static int bonding_attach(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
LOG_MSG("comedi%d\n", dev->minor);
ret = alloc_private(dev, sizeof(*devpriv)); ret = alloc_private(dev, sizeof(*devpriv));
if (ret) if (ret)
return ret; return ret;
...@@ -348,9 +336,9 @@ static int bonding_attach(struct comedi_device *dev, ...@@ -348,9 +336,9 @@ static int bonding_attach(struct comedi_device *dev,
s->insn_bits = bonding_dio_insn_bits; s->insn_bits = bonding_dio_insn_bits;
s->insn_config = bonding_dio_insn_config; s->insn_config = bonding_dio_insn_config;
LOG_MSG("attached with %u DIO channels coming from %u different " dev_info(dev->class_dev,
"subdevices all bonded together. " "%s: %s attached, %u channels from %u devices\n",
"John Lennon would be proud!\n", dev->driver->driver_name, dev->board_name,
devpriv->nchans, devpriv->ndevs); devpriv->nchans, devpriv->ndevs);
return 1; return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment