Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f74ea14 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Staging: comedi: remove comedi-specific wrappers



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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 81874ff7
Loading
Loading
Loading
Loading
+18 −19
Original line number Diff line number Diff line
@@ -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__,
@@ -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;
@@ -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)
@@ -2054,10 +2053,10 @@ 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)
@@ -2065,9 +2064,9 @@ 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;
}

@@ -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);
@@ -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;
@@ -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");
@@ -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));
@@ -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;
}

+3 −5
Original line number Diff line number Diff line
@@ -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;
		}
@@ -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;
@@ -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;
+5 −5
Original line number Diff line number Diff line
@@ -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 */
			}
@@ -447,7 +447,7 @@ 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 {
@@ -455,18 +455,18 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_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;

	}
+7 −7
Original line number Diff line number Diff line
@@ -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;
@@ -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],
@@ -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;
			}
@@ -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");
		}
@@ -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)
+5 −5
Original line number Diff line number Diff line
@@ -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 */
@@ -425,7 +425,7 @@ 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 {
@@ -433,12 +433,12 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_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;
@@ -446,7 +446,7 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
	}

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

Loading