From: Ian Abbott Date: Fri, 14 Sep 2012 16:34:07 +0000 (+0100) Subject: staging: comedi: ni_660x: convert printk() to dev_...() X-Git-Tag: firefly_0821_release~3680^2~1977^2~220 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a8adadee9427e23fe7513fc214fe29f7307e7aa1;p=firefly-linux-kernel-4.4.55.git staging: comedi: ni_660x: convert printk() to dev_...() 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 Reviewed-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 6bd5b5514408..43254cc79482 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -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; @@ -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; } @@ -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; } @@ -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; @@ -1083,7 +1075,7 @@ 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); @@ -1091,8 +1083,6 @@ static int ni_660x_attach(struct comedi_device *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; @@ -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); @@ -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; } @@ -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; }