summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
AgeCommit message (Collapse)Author
2011-12-09Staging: comedi: fix signal handling in read and writeFederico Vaga
commit 6a9ce6b654e491981f6ef7e214cbd4f63e033848 upstream. After sleeping on a wait queue, signal_pending(current) should be checked (not before sleeping). Acked-by: Alessandro Rubini <rubini@gnudd.com> Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09Staging: comedi: fix mmap_countFederico Vaga
commit df30b21cb0eed5ba8a8e0cdfeebc66ba8cde821d upstream. In comedi_fops, mmap_count is decremented at comedi_vm_ops->close but it is not incremented at comedi_vm_ops->open. This may result in a negative counter. The patch introduces the open method to keep the counter consistent. The bug was triggerd by this sample code: mmap(0, ...., comedi_fd); fork(); exit(0); Acked-by: Alessandro Rubini <rubini@gnudd.com> Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09staging: comedi: fix oops for USB DAQ devices.Bernd Porr
commit 3ffab428f40849ed5f21bcfd7285bdef7902f9ca upstream. This fixes kernel oops when an USB DAQ device is plugged out while it's communicating with the userspace software. Signed-off-by: Bernd Porr <berndporr@f2s.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-19staging: fix comedi build when ISA_DMA_API is enabled but COMEDI_PCI is not ↵Randy Dunlap
enabled Fix build when CONFIG_ISA_DMA_API is enabled but CONFIG_COMEDI_PCI[_DRIVERS] is not enabled. Fixes these build errors: drivers/staging/comedi/drivers/ni_labpc.c: In function 'labpc_ai_cmd': drivers/staging/comedi/drivers/ni_labpc.c:1351: error: implicit declaration of function 'labpc_suggest_transfer_size' drivers/staging/comedi/drivers/ni_labpc.c: At top level: drivers/staging/comedi/drivers/ni_labpc.c:1802: error: conflicting types for 'labpc_suggest_transfer_size' drivers/staging/comedi/drivers/ni_labpc.c:1351: note: previous implicit declaration of 'labpc_suggest_transfer_size' was here Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-08Staging: comedi: fix printk issue in rtd520.cRavishankar
This is a patch to the rtd520.c file that fixes up a printk warning found by the checkpatch.pl tool Signed-off-by: Ravishankr <ravishakarkm32@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08Staging: comedi: fix line over 80 character issue in rtd520.cRavishankar
This is a patch to the rtd520.c file that fixes up a warning: line over 80 character found by the checkpatch.pl tool Signed-off-by: Ravishankar <ravishankarkm32@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08Staging: comedi: fix warning issue in unioxx5.cRavishankar
This is a patch to the unioxx5.c file that fixes up a warning found by the checkpatch.pl tool Signed-off-by: Ravishankar <ravishankarkm32@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08Staging: comedi: fix brace coding style issue in serial2002.cRavishankar
This is a patch to the serial2002.c file that fixes up a brace warning found by the checkpatch.pl tool Signed-off-by: Ravishankar <ravishankarkm32@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08Staging: comedi: fix brace and printk coding style issue in serial2002.cRavishankar
This is a patch to the serial2002.c file that fixes up a brace and printk warning found by the checkpatch.pl tool Signed-off-by: Ravishankar <ravishankarkm32@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-06staging: comedi: remove COMEDI_DEVICE_CREATE macro, expand all callersPavel Roskin
This is no longer needed as the code is now in the main kernel tree. Signed-off-by: Pavel Roskin <proski@gnu.org> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05Staging: comedi: das1800: fixed multiple brace coding style issues and ↵Matthew Skolaut
pointer declaration style errors Fixed coding style issues Signed-off-by: Matthew Skolaut <tech2077@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05Staging: comedi: fix prink warning style issue in ni_daq_700.cRavishankar
This is a patch to the ni_daq_700.c file that fixes up a prink warning found by the checkpatch.pl tool Signed-off-by: Ravishankar <ravishankarkm32@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05staging: fix comedi NI labpc driver build when ISA_DMA_API is not enabledRandy Dunlap
Fix ni_labpc.c to build when CONFIG_ISA_DMA_API is not enabled. This is a driver that supports both ISA and PCI devices. It now builds when for PCI-only support or for both ISA and PCI device support. (It does not support ISA-only without PCI.) Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05staging: comedi: fix infoleak to userspaceVasiliy Kulikov
driver_name and board_name are pointers to strings, not buffers of size COMEDI_NAMELEN. Copying COMEDI_NAMELEN bytes of a string containing less than COMEDI_NAMELEN-1 bytes would leak some unrelated bytes. Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05Staging: comedi: usbdux: release locks on error pathsDan Carpenter
Smatch complains about a couple error paths where the semaphores were not released. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05Staging: comedi: add dyna_pci10xx driver to MakefilePrashant P. Shah
Add dyna_pci10xx entry to comedi Kconfig and Makefile Signed-off-by: Prashant P. Shah <pshah.mumbai@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05Staging: comedi: add dyna_pci10xx driverPrashant P. Shah
For Dynalog PCI DAQ cards: PCI-1050 Signed-off-by: Prashant P. Shah <pshah.mumbai@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05Merge Linux 3.0-rc6 into staging-nextGreg Kroah-Hartman
This handles the merge conflicts with the drivers/staging/brcm80211/Kconfig file due to changes on the two different branches. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging: comedi (adv_pci1723): coding style, fix whitespace before quoted ↵Matt Billenstein
newline Small fix in adv_pci1723.c for a "whitespace before quoted newline" warning from checkpatch.pl Signed-off-by: Matt Billenstein <matt@vazor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging: comedi: fixed a declaration coding style issueRalf Thielow
Fixed a declaration coding style issue. Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging: remove unnecessary codeGreg Dietsche
Compile tested. remove unnecessary code that matches this coccinelle pattern if (...) return ret; return ret; Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu> Acked-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-27Staging: comedi: fix build breakages on some platformsGreg Kroah-Hartman
Some platforms do not have virt_to_bus(), so properly depend on CONFIG_VIRT_TO_BUS for the Comedi drivers that need this function. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-27Staging: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHERalf Baechle
On architectures that don't define PAGE_KERNEL_NOCACHE, the Comedi driver turns into tragedy: CC [M] drivers/staging/comedi/drivers.o drivers/staging/comedi/drivers.c: In function ‘comedi_buf_alloc’: drivers/staging/comedi/drivers.c:505:41: error: ‘PAGE_KERNEL_NOCACHE’ undeclared (first use in this function) drivers/staging/comedi/drivers.c:505:41: note: each undeclared identifier is rep orted only once for each function it appears in make[3]: *** [drivers/staging/comedi/drivers.o] Error 1 Restrict the driver to only those architectures that define PAGE_KERNEL_NOCACHE. PAGE_KERNEL_NOCACHE is a kludge - some system architectures such as SGI IP27 are even uable to offer uncached operation - at least in the way an unwitting driver might assume. I haven't looked in details how the driver is using the area vmaped with PAGE_KERNEL_NOCACHE but maybe doing it XFS-style using cached memory and the flush_kernel_vmap_range / invalidate_kernel_vmap_range APIs in conjunction with the DMA API is a practical alternative. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Reported-by: David Miller <davem@davemloft.net> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-09Staging: comedi: add #include <linux/io.h> to a bunch of driversGreg Kroah-Hartman
On some arches the function virt_to_bus() wasn't being pulled in due to include chains being different. So, as we are explicitly calling this function, explicitly include the proper header file so all will build properly. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-09Staging: comedi: drivers.c: fix PAGE_KERNEL_NOCACHE issueGreg Kroah-Hartman
Not all arches have PAGE_KERNEL_NOCACHE, so use the "normal" PAGE_KERNEL on those that do not have it. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-24Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: pcmcia: Make struct pcmcia_device_id const, sound drivers edition staging: pcmcia: Convert pcmcia_device_id declarations to const pcmcia: Convert pcmcia_device_id declarations to const pcmcia: Make declaration and uses of struct pcmcia_device_id const pcmcia/sa1100: put sa11x0_pcmcia_hw_init[] to .devinit.data
2011-05-18comedi vmk80xx: support comedi auto-configurationJ. Ali Harlow
Add support for automatically associating a vmk8055 device with a comedi device (previously the user had to use comedi_num_legacy_minors to reserve device slots and then associate them with vmk8055 devices using comedi_config). Tested on multiple K8055s, but not on K8061s. Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-18comedi vmk80xx: support bits instructionJ. Ali Harlow
Calling comedi_dio_bifield2() returns EBUSY permanently. Implementing the insn_bits call fixes the problem and is good in its own right since one can then read and write to all the digitial lines at the same time. Tested on a K8055, but not on a K8061. Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-18comedi vmk80xx: extend rudimentary_check to check both directionsJ. Ali Harlow
rudimentary_check() can currently check whether the input or output direction is currently available (no pending transaction), but not both at the same time. We need this facility for do_bits(). Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-18comedi vmk80xx: simplify rinsn output calculationJ. Ali Harlow
vmk80xx_di_rinsn() and vmk80xx_do_rinsn() extract the required channel data by inconsistent and overly-complex algorithms. Simplify them both. Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-18comedi vmk80xx: Digitial I/O should have a maxdata of 1J. Ali Harlow
Digitial input and output sub-devices were reporting a maxdata of 0x1F and 0xFF respectively. They should both be 1. Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-18comedi vmk80xx: make rudimentary_check a static functionJ. Ali Harlow
rudimentary_check is a macro with side-effects (it returns on error) which is contary to CodingStyle. Replace it with a static function. Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17staging: comedi: addi-data: Get rid of redundant ps_BoardInfoIan Abbott
The ps_BoardInfo pointer in the device private data is redundant as we can just use the this_board macro to access the same data, as is done elsewhere in the code. Get rid of the pointer and change the code to use the this_board macro instead. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17staging: comedi: addi-data: Don't overwrite read-only dataIan Abbott
The drivers for ADDI-DATA cards can override some static parameters for the board type using information read from EEPROM. Unfortunately, they currently write the parameters from the EEPROM back to the shared, read-only board data! The problem has been masked during compilation by type-casting away the const-ness of the data. This patch changes the code to use an area in the private data for the board instance to hold the parameters read from EEPROM (after initializing the parameters from the static board data). It also changes the type-casts to the read-only data to preserve the const qualifier. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17staging: comedi: adv_pci_dio: Add a counter subdevice to PCI-1751Ian Abbott
The Advantech PCI-1751 has a 8254 counter chip on board. Add it to the device as a counter subdevice. Apparently the counter can generate interrupts although the driver does not currently use this capability. Original patch by Ivan Russkih (Иван Русских) <vanekrus at gmail dot com>. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17comedi vmk80xx: Style improvementsJ. Ali Harlow
Style improvements to comedi driver vmk80xx: * One variable definition per line * Block quotes start and end with near-empty lines * If..else statements use braces for both branches * Egregious blank lines removed * Use if..else rather than goto where trivial * Don't put function return type on a separate line Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10Staging: comedi: fix brace coding style issue in jr3_pci.cStephane Pajot
This is a patch to the jr3_pci.c file that fixes up a brace warning found by the checkpatch.pl tool Signed-off-by: Stephane Pajot <pajot.stephane@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06staging: pcmcia: Convert pcmcia_device_id declarations to constJoe Perches
Reduces data, increases text. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2011-04-25staging: comedi: fix a typoWeiping Pan(潘卫平)
replace tranmitted with transmitted. Signed-off-by: Weiping Pan(潘卫平) <panweiping3@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25staging: Remove unnecessary semicolons when switch (foo) {...};Joe Perches
Done via perl script: $ cat remove_semi_switch.pl my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/; my $match_balanced_braces = qr/(\{(?:[^\{\}]++|(?-1))*\})/; foreach my $file (@ARGV) { my $f; my $text; my $oldtext; next if ((-d $file)); open($f, '<', $file) or die "$P: Can't open $file for read\n"; $oldtext = do { local($/) ; <$f> }; close($f); next if ($oldtext eq ""); $text = $oldtext; my $count = 0; do { $count = 0; $count += $text =~ s@\b(switch\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx; } while ($count > 0); if ($text ne $oldtext) { my $newfile = $file; open($f, '>', $newfile) or die "$P: Can't open $newfile for write\n"; print $f $text; close($f); } } $ Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25staging: Remove unnecessary semicolons when for (foo) {...};Joe Perches
Done via perl script: $ cat remove_semi_for.pl my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/; my $match_balanced_braces = qr/(\{(?:[^\{\}]++|(?-1))*\})/; foreach my $file (@ARGV) { my $f; my $text; my $oldtext; next if ((-d $file)); open($f, '<', $file) or die "$P: Can't open $file for read\n"; $oldtext = do { local($/) ; <$f> }; close($f); next if ($oldtext eq ""); $text = $oldtext; my $count = 0; do { $count = 0; $count += $text =~ s@\b(for\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx; } while ($count > 0); if ($text ne $oldtext) { my $newfile = $file; open($f, '>', $newfile) or die "$P: Can't open $newfile for write\n"; print $f $text; close($f); } } $ Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-20staging/comedi: remove German in-file changelogUwe Kleine-König
My script that finds typos always wants to do s/Funktion/Function/. Instead of adding some whilelist logic to my script just delete the changelog that is useless in general and still more in this case as most kernel developers don't understand it. Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-14staging: comedi: Remove NULL check before kfreeIlia Mirkin
This patch was generated by the following semantic patch: // <smpl> @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; // </smpl> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-28staging: comedi: pcl818.c remove one to many l's in the word.Justin P. Mattock
The patch below removes an extra "l" in the word. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-28staging: comedi: pcl816.c remove one to many l's in the word.Justin P. Mattock
The patch below removes an extra "l" in the word. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18Merge 2.6.38-rc5 into staging-nextGreg Kroah-Hartman
This is to resolve a merge conflict with: drivers/staging/zram/zram_drv.c as pointed out by Stephen Rothwell Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Robert Jennings <rcj@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-09Staging: Comedi: Fix a few NI module dependenciesIan Abbott
The ni_tio and ni_tio modules do not depend on the 8255 module, but the ni_atmio, ni_mio_cs and ni_pcimio modules do need the 8255 module. The ni_pcimio module also needs the comedi_fc module. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-09Staging: comedi: Add MODULE_LICENSE and similar to NI modulesIan Abbott
As mentioned by W. Trevor King on the devel@linuxdriverproject.org list on "Thu, 27 Jan 2011 18:52:15 -0500", "Message-ID: <20110127235214.GA5107@thialfi.dhcp.drexel.edu>", the ni_pcimio module is missing module metadata, including a license. This patch adds module metadata to all the NI comedi driver modules. It also removes a duplicate MODULE_LICENSE("GPL") line from the "mite" module. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: W. Trevor King <wking@drexel.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04staging: comedi: fix coding style issue in drivers.cMicha Hergarden
This is a patch to the drivers.c file that fixes up a braces around single statement warning found by the checkpatch.pl tool Signed-off-by: Micha Hergarden <micha.hergarden@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>