Skip to content

Commit

Permalink
Staging: comedi: remove comedi-specific wrappers
Browse files Browse the repository at this point in the history
There are a number of comedi "wrappers" for some RT functions that are
about to go away.  This patch removes all of the wrapper calls within
the comedi drivers and core in order to prepare for removing the RT
comedi code.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Jun 19, 2009
1 parent 81874ff commit 5f74ea1
Show file tree
Hide file tree
Showing 86 changed files with 1,026 additions and 1,061 deletions.
37 changes: 18 additions & 19 deletions drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ static int check_insn_config_length(struct comedi_insn *insn, unsigned int *data
/* by default we allow the insn since we don't have checks for
* all possible cases yet */
default:
rt_printk("comedi: no check for data length of config insn id "
printk("comedi: no check for data length of config insn id "
"%i is implemented.\n"
" Add a check to %s in %s.\n"
" Assuming n=%i is correct.\n", data[0], __func__,
Expand Down Expand Up @@ -1219,12 +1219,12 @@ static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg, void *file
return -EINVAL;
s = dev->subdevices + arg;

comedi_spin_lock_irqsave(&s->spin_lock, flags);
spin_lock_irqsave(&s->spin_lock, flags);
if (s->busy || s->lock)
ret = -EBUSY;
else
s->lock = file;
comedi_spin_unlock_irqrestore(&s->spin_lock, flags);
spin_unlock_irqrestore(&s->spin_lock, flags);

if (ret < 0)
return ret;
Expand Down Expand Up @@ -1984,8 +1984,7 @@ module_exit(comedi_cleanup);

void comedi_error(const struct comedi_device *dev, const char *s)
{
rt_printk("comedi%d: %s: %s\n", dev->minor, dev->driver->driver_name,
s);
printk("comedi%d: %s: %s\n", dev->minor, dev->driver->driver_name, s);
}

void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s)
Expand Down Expand Up @@ -2054,20 +2053,20 @@ void comedi_set_subdevice_runflags(struct comedi_subdevice *s, unsigned mask,
{
unsigned long flags;

comedi_spin_lock_irqsave(&s->spin_lock, flags);
spin_lock_irqsave(&s->spin_lock, flags);
s->runflags &= ~mask;
s->runflags |= (bits & mask);
comedi_spin_unlock_irqrestore(&s->spin_lock, flags);
spin_unlock_irqrestore(&s->spin_lock, flags);
}

unsigned comedi_get_subdevice_runflags(struct comedi_subdevice *s)
{
unsigned long flags;
unsigned runflags;

comedi_spin_lock_irqsave(&s->spin_lock, flags);
spin_lock_irqsave(&s->spin_lock, flags);
runflags = s->runflags;
comedi_spin_unlock_irqrestore(&s->spin_lock, flags);
spin_unlock_irqrestore(&s->spin_lock, flags);
return runflags;
}

Expand Down Expand Up @@ -2125,14 +2124,14 @@ int comedi_alloc_board_minor(struct device *hardware_device)
return -ENOMEM;
}
comedi_device_init(info->device);
comedi_spin_lock_irqsave(&comedi_file_info_table_lock, flags);
spin_lock_irqsave(&comedi_file_info_table_lock, flags);
for (i = 0; i < COMEDI_NUM_BOARD_MINORS; ++i) {
if (comedi_file_info_table[i] == NULL) {
comedi_file_info_table[i] = info;
break;
}
}
comedi_spin_unlock_irqrestore(&comedi_file_info_table_lock, flags);
spin_unlock_irqrestore(&comedi_file_info_table_lock, flags);
if (i == COMEDI_NUM_BOARD_MINORS) {
comedi_device_cleanup(info->device);
kfree(info->device);
Expand Down Expand Up @@ -2184,10 +2183,10 @@ void comedi_free_board_minor(unsigned minor)
struct comedi_device_file_info *info;

BUG_ON(minor >= COMEDI_NUM_BOARD_MINORS);
comedi_spin_lock_irqsave(&comedi_file_info_table_lock, flags);
spin_lock_irqsave(&comedi_file_info_table_lock, flags);
info = comedi_file_info_table[minor];
comedi_file_info_table[minor] = NULL;
comedi_spin_unlock_irqrestore(&comedi_file_info_table_lock, flags);
spin_unlock_irqrestore(&comedi_file_info_table_lock, flags);

if (info) {
struct comedi_device *dev = info->device;
Expand Down Expand Up @@ -2218,14 +2217,14 @@ int comedi_alloc_subdevice_minor(struct comedi_device *dev,
info->device = dev;
info->read_subdevice = s;
info->write_subdevice = s;
comedi_spin_lock_irqsave(&comedi_file_info_table_lock, flags);
spin_lock_irqsave(&comedi_file_info_table_lock, flags);
for (i = COMEDI_FIRST_SUBDEVICE_MINOR; i < COMEDI_NUM_MINORS; ++i) {
if (comedi_file_info_table[i] == NULL) {
comedi_file_info_table[i] = info;
break;
}
}
comedi_spin_unlock_irqrestore(&comedi_file_info_table_lock, flags);
spin_unlock_irqrestore(&comedi_file_info_table_lock, flags);
if (i == COMEDI_NUM_MINORS) {
kfree(info);
printk(KERN_ERR "comedi: error: ran out of minor numbers for board device files.\n");
Expand Down Expand Up @@ -2283,10 +2282,10 @@ void comedi_free_subdevice_minor(struct comedi_subdevice *s)
BUG_ON(s->minor >= COMEDI_NUM_MINORS);
BUG_ON(s->minor < COMEDI_FIRST_SUBDEVICE_MINOR);

comedi_spin_lock_irqsave(&comedi_file_info_table_lock, flags);
spin_lock_irqsave(&comedi_file_info_table_lock, flags);
info = comedi_file_info_table[s->minor];
comedi_file_info_table[s->minor] = NULL;
comedi_spin_unlock_irqrestore(&comedi_file_info_table_lock, flags);
spin_unlock_irqrestore(&comedi_file_info_table_lock, flags);

if (s->class_dev) {
device_destroy(comedi_class, MKDEV(COMEDI_MAJOR, s->minor));
Expand All @@ -2301,9 +2300,9 @@ struct comedi_device_file_info *comedi_get_device_file_info(unsigned minor)
struct comedi_device_file_info *info;

BUG_ON(minor >= COMEDI_NUM_MINORS);
comedi_spin_lock_irqsave(&comedi_file_info_table_lock, flags);
spin_lock_irqsave(&comedi_file_info_table_lock, flags);
info = comedi_file_info_table[minor];
comedi_spin_unlock_irqrestore(&comedi_file_info_table_lock, flags);
spin_unlock_irqrestore(&comedi_file_info_table_lock, flags);
return info;
}

Expand Down
8 changes: 3 additions & 5 deletions drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ unsigned int comedi_buf_munge(struct comedi_async *async, unsigned int num_bytes

block_size = num_bytes - count;
if (block_size < 0) {
rt_printk("%s: %s: bug! block_size is negative\n",
printk("%s: %s: bug! block_size is negative\n",
__FILE__, __func__);
break;
}
Expand Down Expand Up @@ -633,8 +633,7 @@ unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes)
{
if ((int)(async->buf_write_count + nbytes -
async->buf_write_alloc_count) > 0) {
rt_printk
("comedi: attempted to write-free more bytes than have been write-allocated.\n");
printk("comedi: attempted to write-free more bytes than have been write-allocated.\n");
nbytes = async->buf_write_alloc_count - async->buf_write_count;
}
async->buf_write_count += nbytes;
Expand Down Expand Up @@ -667,8 +666,7 @@ unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes)
smp_mb();
if ((int)(async->buf_read_count + nbytes -
async->buf_read_alloc_count) > 0) {
rt_printk
("comedi: attempted to read-free more bytes than have been read-allocated.\n");
printk("comedi: attempted to read-free more bytes than have been read-allocated.\n");
nbytes = async->buf_read_alloc_count - async->buf_read_count;
}
async->buf_read_count += nbytes;
Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ int i_find_free_pci_card_by_position(unsigned short vendor_id,
*card = amcc;
return 0; /* ok, card is found */
} else {
rt_printk(" - \nCard on requested position is used b:s %d:%d!\n",
printk(" - \nCard on requested position is used b:s %d:%d!\n",
pci_bus, pci_slot);
return 2; /* card exist but is used */
}
Expand Down Expand Up @@ -447,26 +447,26 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
/* use autodetection */
card = ptr_find_free_pci_card_by_device(vendor_id, device_id);
if (card == NULL) {
rt_printk(" - Unused card not found in system!\n");
printk(" - Unused card not found in system!\n");
return NULL;
}
} else {
switch (i_find_free_pci_card_by_position(vendor_id, device_id,
pci_bus, pci_slot,
&card)) {
case 1:
rt_printk(" - Card not found on requested position b:s %d:%d!\n",
printk(" - Card not found on requested position b:s %d:%d!\n",
pci_bus, pci_slot);
return NULL;
case 2:
rt_printk(" - Card on requested position is used b:s %d:%d!\n",
printk(" - Card on requested position is used b:s %d:%d!\n",
pci_bus, pci_slot);
return NULL;
}
}

if (pci_card_alloc(card, i_Master) != 0) {
rt_printk(" - Can't allocate card!\n");
printk(" - Can't allocate card!\n");
return NULL;

}
Expand Down
14 changes: 7 additions & 7 deletions drivers/staging/comedi/drivers/addi-data/addi_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
v_pci_card_list_init(this_board->i_VendorId, 1); /* 1 for displaying the list.. */
pci_list_builded = 1;
}
/* rt_printk("comedi%d: addi_common: board=%s",dev->minor,this_board->pc_DriverName); */
/* printk("comedi%d: addi_common: board=%s",dev->minor,this_board->pc_DriverName); */

if ((this_board->i_Dma) && (it->options[2] == 0)) {
i_Dma = 1;
Expand Down Expand Up @@ -2648,16 +2648,16 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* ## */

if (irq > 0) {
if (comedi_request_irq(irq, v_ADDI_Interrupt, IRQF_SHARED,
if (request_irq(irq, v_ADDI_Interrupt, IRQF_SHARED,
c_Identifier, dev) < 0) {
printk(", unable to allocate IRQ %u, DISABLING IT",
irq);
irq = 0; /* Can't use IRQ */
} else {
rt_printk("\nirq=%u", irq);
printk("\nirq=%u", irq);
}
} else {
rt_printk(", IRQ disabled");
printk(", IRQ disabled");
}

printk("\nOption %d %d %d\n", it->options[0], it->options[1],
Expand Down Expand Up @@ -2719,7 +2719,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
}
}
if (!devpriv->ul_DmaBufferVirtual[0]) {
rt_printk
printk
(", Can't allocate DMA buffer, DMA disabled!");
devpriv->us_UseDma = ADDI_DISABLE;
}
Expand All @@ -2730,7 +2730,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
}

if ((devpriv->us_UseDma == ADDI_ENABLE)) {
rt_printk("\nDMA ENABLED\n");
printk("\nDMA ENABLED\n");
} else {
printk("\nDMA DISABLED\n");
}
Expand Down Expand Up @@ -2937,7 +2937,7 @@ static int i_ADDI_Detach(struct comedi_device *dev)
}

if (dev->irq) {
comedi_free_irq(dev->irq, dev);
free_irq(dev->irq, dev);
}

if ((devpriv->ps_BoardInfo->pc_EepromChip == NULL)
Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/comedi/drivers/addi-data/amcc_s5933_58.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ int i_find_free_pci_card_by_position(unsigned short vendor_id,
*card = amcc;
return 0; /* ok, card is found */
} else {
rt_printk
printk
(" - \nCard on requested position is used b:s %d:%d!\n",
pci_bus, pci_slot);
return 2; /* card exist but is used */
Expand Down Expand Up @@ -425,28 +425,28 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
if ((pci_bus < 1) & (pci_slot < 1)) { /* use autodetection */
card = ptr_find_free_pci_card_by_device(vendor_id, device_id);
if (card == NULL) {
rt_printk(" - Unused card not found in system!\n");
printk(" - Unused card not found in system!\n");
return NULL;
}
} else {
switch (i_find_free_pci_card_by_position(vendor_id, device_id,
pci_bus, pci_slot,
&card)) {
case 1:
rt_printk
printk
(" - Card not found on requested position b:s %d:%d!\n",
pci_bus, pci_slot);
return NULL;
case 2:
rt_printk
printk
(" - Card on requested position is used b:s %d:%d!\n",
pci_bus, pci_slot);
return NULL;
}
}

if (i_pci_card_alloc(card) != 0) {
rt_printk(" - Can't allocate card!\n");
printk(" - Can't allocate card!\n");
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
Original file line number Diff line number Diff line change
Expand Up @@ -2637,7 +2637,7 @@ int i_APCI3120_InsnWriteAnalogOutput(struct comedi_device *dev,
}

/*
* out put n values at the given channel. rt_printk("\nwaiting for
* out put n values at the given channel. printk("\nwaiting for
* DA_READY BIT");
*/
do /* Waiting of DA_READY BIT */
Expand Down
15 changes: 7 additions & 8 deletions drivers/staging/comedi/drivers/adl_pci9111.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ static void pci9111_timer_set(struct comedi_device *dev)
PCI9111_8254_READ_LOAD_LSB_MSB |
PCI9111_8254_MODE_2 | PCI9111_8254_BINARY_COUNTER);

comedi_udelay(1);
udelay(1);

pci9111_8254_counter_2_set(dev_private->timer_divisor_2);
pci9111_8254_counter_1_set(dev_private->timer_divisor_1);
Expand Down Expand Up @@ -901,7 +901,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)

async = subdevice->async;

comedi_spin_lock_irqsave(&dev->spinlock, irq_flags);
spin_lock_irqsave(&dev->spinlock, irq_flags);

/* Check if we are source of interrupt */
intcsr = inb(dev_private->lcr_io_base +
Expand All @@ -919,7 +919,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)
PLX9050_LINTI2_STATUS))))) {
/* Not the source of the interrupt. */
/* (N.B. not using PLX9050_SOFTWARE_INTERRUPT) */
comedi_spin_unlock_irqrestore(&dev->spinlock, irq_flags);
spin_unlock_irqrestore(&dev->spinlock, irq_flags);
return IRQ_NONE;
}

Expand All @@ -928,7 +928,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)
/* Interrupt comes from fifo_half-full signal */

if (pci9111_is_fifo_full()) {
comedi_spin_unlock_irqrestore(&dev->spinlock,
spin_unlock_irqrestore(&dev->spinlock,
irq_flags);
comedi_error(dev, PCI9111_DRIVER_NAME " fifo overflow");
pci9111_interrupt_clear();
Expand Down Expand Up @@ -1028,7 +1028,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)

pci9111_interrupt_clear();

comedi_spin_unlock_irqrestore(&dev->spinlock, irq_flags);
spin_unlock_irqrestore(&dev->spinlock, irq_flags);

comedi_event(dev, subdevice);

Expand Down Expand Up @@ -1298,8 +1298,7 @@ static int pci9111_attach(struct comedi_device *dev, struct comedi_devconfig *it

dev->irq = 0;
if (pci_device->irq > 0) {
if (comedi_request_irq(pci_device->irq,
pci9111_interrupt,
if (request_irq(pci_device->irq, pci9111_interrupt,
IRQF_SHARED, PCI9111_DRIVER_NAME, dev) != 0) {
printk("comedi%d: unable to allocate irq %u\n",
dev->minor, pci_device->irq);
Expand Down Expand Up @@ -1379,7 +1378,7 @@ static int pci9111_detach(struct comedi_device *dev)
/* Release previously allocated irq */

if (dev->irq != 0) {
comedi_free_irq(dev->irq, dev);
free_irq(dev->irq, dev);
}

if (dev_private != 0 && dev_private->pci_device != 0) {
Expand Down
Loading

0 comments on commit 5f74ea1

Please sign in to comment.