Skip to content

Commit

Permalink
staging: comedi: ni_660x: convert printk() to dev_...()
Browse files Browse the repository at this point in the history
Convert the `printk()` calls in this drivers to use the `dev_...()`
calls instead.  Replace some `printk()` calls in the comedi `attach()`
handler (`ni_660x_attach()`) with a single `dev_info()` at the end.
Remove some `printk()` calls before `BUG()` calls.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Sep 17, 2012
1 parent c50e993 commit a8adade
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions drivers/staging/comedi/drivers/ni_660x.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,6 @@ static enum NI_660x_Register ni_gpct_to_660x_register(enum ni_gpct_register reg)
ni_660x_register = G3InterruptEnable;
break;
default:
printk(KERN_WARNING "%s: unhandled register 0x%x in switch.\n",
__func__, reg);
BUG();
return 0;
break;
Expand All @@ -773,8 +771,6 @@ static inline void ni_660x_write_register(struct comedi_device *dev,
writel(bits, write_address);
break;
default:
printk(KERN_WARNING "%s: %s: bug! unhandled case (reg=0x%x) in switch.\n",
__FILE__, __func__, reg);
BUG();
break;
}
Expand All @@ -796,8 +792,6 @@ static inline unsigned ni_660x_read_register(struct comedi_device *dev,
return readl(read_address);
break;
default:
printk(KERN_WARNING "%s: %s: bug! unhandled case (reg=0x%x) in switch.\n",
__FILE__, __func__, reg);
BUG();
break;
}
Expand Down Expand Up @@ -1070,8 +1064,6 @@ static int ni_660x_attach(struct comedi_device *dev,
unsigned i;
unsigned global_interrupt_config_bits;

printk(KERN_INFO "comedi%d: ni_660x: ", dev->minor);

ret = ni_660x_allocate_private(dev);
if (ret < 0)
return ret;
Expand All @@ -1083,16 +1075,14 @@ static int ni_660x_attach(struct comedi_device *dev,

ret = mite_setup2(private(dev)->mite, 1);
if (ret < 0) {
printk(KERN_WARNING "error setting up mite\n");
dev_warn(dev->class_dev, "error setting up mite\n");
return ret;
}
comedi_set_hw_dev(dev, &private(dev)->mite->pcidev->dev);
ret = ni_660x_alloc_mite_rings(dev);
if (ret < 0)
return ret;

printk(KERN_INFO " %s ", dev->board_name);

ret = comedi_alloc_subdevices(dev, 2 + NI_660X_MAX_NUM_COUNTERS);
if (ret)
return ret;
Expand Down Expand Up @@ -1174,7 +1164,7 @@ static int ni_660x_attach(struct comedi_device *dev,
ret = request_irq(mite_irq(private(dev)->mite), ni_660x_interrupt,
IRQF_SHARED, "ni_660x", dev);
if (ret < 0) {
printk(KERN_WARNING " irq not available\n");
dev_warn(dev->class_dev, " irq not available\n");
return ret;
}
dev->irq = mite_irq(private(dev)->mite);
Expand All @@ -1183,7 +1173,7 @@ static int ni_660x_attach(struct comedi_device *dev,
global_interrupt_config_bits |= Cascade_Int_Enable_Bit;
ni_660x_write_register(dev, 0, global_interrupt_config_bits,
GlobalInterruptConfigRegister);
printk(KERN_INFO "attached\n");
dev_info(dev->class_dev, "ni_660x: %s attached\n", dev->board_name);
return 0;
}

Expand Down Expand Up @@ -1262,7 +1252,7 @@ static int ni_660x_find_device(struct comedi_device *dev, int bus, int slot)
}
}
}
printk(KERN_WARNING "no device found\n");
dev_warn(dev->class_dev, "no device found\n");
mite_list_devices();
return -EIO;
}
Expand Down

0 comments on commit a8adade

Please sign in to comment.