提交 92e462c3 编写于 作者: D Dirk Hohndel 提交者: Greg Kroah-Hartman

Staging: comedi: gsc_hpdi: style fixes printk

Style cleanup in staging based on Greg's tutorial / checkpatch
Add printk KERN_ facility level (KERN_WARNING seemed appropriate for all)
Signed-off-by: NDirk Hohndel <hohndel@infradead.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 a8c5c198
...@@ -110,7 +110,8 @@ enum hpdi_registers { ...@@ -110,7 +110,8 @@ enum hpdi_registers {
int command_channel_valid(unsigned int channel) int command_channel_valid(unsigned int channel)
{ {
if (channel == 0 || channel > 6) { if (channel == 0 || channel > 6) {
printk("gsc_hpdi: bug! invalid cable command channel\n"); printk(KERN_WARNING
"gsc_hpdi: bug! invalid cable command channel\n");
return 0; return 0;
} }
return 1; return 1;
...@@ -560,7 +561,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -560,7 +561,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
int i; int i;
int retval; int retval;
printk("comedi%d: gsc_hpdi\n", dev->minor); printk(KERN_WARNING "comedi%d: gsc_hpdi\n", dev->minor);
if (alloc_private(dev, sizeof(struct hpdi_private)) < 0) if (alloc_private(dev, sizeof(struct hpdi_private)) < 0)
return -ENOMEM; return -ENOMEM;
...@@ -588,11 +589,12 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -588,11 +589,12 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
} while (pcidev != NULL); } while (pcidev != NULL);
} }
if (dev->board_ptr == NULL) { if (dev->board_ptr == NULL) {
printk("gsc_hpdi: no hpdi card found\n"); printk(KERN_WARNING "gsc_hpdi: no hpdi card found\n");
return -EIO; return -EIO;
} }
printk("gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name, printk(KERN_WARNING
"gsc_hpdi: found %s on bus %i, slot %i\n", board(dev)->name,
pcidev->bus->number, PCI_SLOT(pcidev->devfn)); pcidev->bus->number, PCI_SLOT(pcidev->devfn));
if (comedi_pci_enable(pcidev, driver_hpdi.driver_name)) { if (comedi_pci_enable(pcidev, driver_hpdi.driver_name)) {
...@@ -618,7 +620,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -618,7 +620,7 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
ioremap(priv(dev)->hpdi_phys_iobase, ioremap(priv(dev)->hpdi_phys_iobase,
pci_resource_len(pcidev, HPDI_BADDRINDEX)); pci_resource_len(pcidev, HPDI_BADDRINDEX));
if (!priv(dev)->plx9080_iobase || !priv(dev)->hpdi_iobase) { if (!priv(dev)->plx9080_iobase || !priv(dev)->hpdi_iobase) {
printk(" failed to remap io memory\n"); printk(KERN_WARNING " failed to remap io memory\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -630,12 +632,13 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -630,12 +632,13 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* get irq */ /* get irq */
if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED, if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
driver_hpdi.driver_name, dev)) { driver_hpdi.driver_name, dev)) {
printk(" unable to allocate irq %u\n", pcidev->irq); printk(KERN_WARNING
" unable to allocate irq %u\n", pcidev->irq);
return -EINVAL; return -EINVAL;
} }
dev->irq = pcidev->irq; dev->irq = pcidev->irq;
printk(" irq %u\n", dev->irq); printk(KERN_WARNING " irq %u\n", dev->irq);
/* alocate pci dma buffers */ /* alocate pci dma buffers */
for (i = 0; i < NUM_DMA_BUFFERS; i++) { for (i = 0; i < NUM_DMA_BUFFERS; i++) {
...@@ -653,7 +656,8 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -653,7 +656,8 @@ static int hpdi_attach(struct comedi_device *dev, struct comedi_devconfig *it)
&priv(dev)-> &priv(dev)->
dma_desc_phys_addr); dma_desc_phys_addr);
if (priv(dev)->dma_desc_phys_addr & 0xf) { if (priv(dev)->dma_desc_phys_addr & 0xf) {
printk(" dma descriptors not quad-word aligned (bug)\n"); printk(KERN_WARNING
" dma descriptors not quad-word aligned (bug)\n");
return -EIO; return -EIO;
} }
...@@ -672,7 +676,7 @@ static int hpdi_detach(struct comedi_device *dev) ...@@ -672,7 +676,7 @@ static int hpdi_detach(struct comedi_device *dev)
{ {
unsigned int i; unsigned int i;
printk("comedi%d: gsc_hpdi: remove\n", dev->minor); printk(KERN_WARNING "comedi%d: gsc_hpdi: remove\n", dev->minor);
if (dev->irq) if (dev->irq)
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册