summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/serial2002.c
AgeCommit message (Collapse)Author
2018-02-11vfs: do bulk POLL* -> EPOLL* replacementLinus Torvalds
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-02-01Merge tag 'staging-4.16-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging/IIO updates from Greg KH: "Here is the big Staging and IIO driver patches for 4.16-rc1. There is the normal amount of new IIO drivers added, like all releases. The networking IPX and the ncpfs filesystem are moved into the staging tree, as they are on their way out of the kernel due to lack of use anymore. The visorbus subsystem finall has started moving out of the staging tree to the "real" part of the kernel, and the most and fsl-mc codebases are almost ready to move out, that will probably happen for 4.17-rc1 if all goes well. Other than that, there is a bunch of license header cleanups in the tree, along with the normal amount of coding style churn that we all know and love for this codebase. I also got frustrated at the Meltdown/Spectre mess and took it out on the dgnc tty driver, deleting huge chunks of it that were never even being used. Full details of everything is in the shortlog. All of these patches have been in linux-next for a while with no reported issues" * tag 'staging-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (627 commits) staging: rtlwifi: remove redundant initialization of 'cfg_cmd' staging: rtl8723bs: remove a couple of redundant initializations staging: comedi: reformat lines to 80 chars or less staging: lustre: separate a connection destroy from free struct kib_conn Staging: rtl8723bs: Use !x instead of NULL comparison Staging: rtl8723bs: Remove dead code Staging: rtl8723bs: Change names to conform to the kernel code staging: ccree: Fix missing blank line after declaration staging: rtl8188eu: remove redundant initialization of 'pwrcfgcmd' staging: rtlwifi: remove unused RTLHALMAC_ST and RTLPHYDM_ST staging: fbtft: remove unused FB_TFT_SSD1325 kconfig staging: comedi: dt2811: remove redundant initialization of 'ns' staging: wilc1000: fix alignments to match open parenthesis staging: wilc1000: removed unnecessary defined enums typedef staging: wilc1000: remove unnecessary use of parentheses staging: rtl8192u: remove redundant initialization of 'timeout' staging: sm750fb: fix CamelCase for dispSet var staging: lustre: lnet/selftest: fix compile error on UP build staging: rtl8723bs: hal_com_phycfg: Remove unneeded semicolons staging: rts5208: Fix "seg_no" calculation in reset_ms_card() ...
2017-12-13Staging: comedi: drivers: serial2002 fixed a blank line coding styleVikash Kesarwani
Fixed a blank line coding style after a declaration Signed-off-by: Vikash Kesarwani <vikash.ckiiita30@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: comedi: drivers: Remove redundant license textGreg Kroah-Hartman
Now that the SPDX tag is in all comedi files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: comedi: add SPDX identifiers to all greybus driver filesGreg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/staging/comedi files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27anntotate the places where ->poll() return values goAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-09-04serial2002: switch serial2002_tty_write to kernel_{read/write}Christoph Hellwig
Instead of playing games with the address limit. This also gains us proper usage of the write counter, time stamp updates and kvec validation. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2016-06-17staging: comedi: serial2002: Fix unnecessary cast styling issueChris Cesare
checkpatch.pl warns that a cast of 1 to (long long) is unnecessary. Remove the cast and also add code to check and make sure that maxdata_list[chan] is not shifted too far, as suggested by Ian Abbott. Signed-off-by Chris Cesare <chris.cesare@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging: comedi: serial2002: Fix bare unsigned styling issueChris Cesare
checkpatch.pl warns about a bare unsigned. Add type int to make explicit and suit the coding style. Signed-off-by Chris Cesare <chris.cesare@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: comedi: serial2002: use proper errnoH Hartley Sweeten
checkpatch.pl reports: WARNING: ENOSYS means 'invalid syscall nr' and nothing else Change the error code to -ENOTTY. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: comedi: serial2002: usleep_range is preferred over udelayH Hartley Sweeten
Fix checkpatch issue: "CHECK: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt". Replace the udelay() with usleep_range() with a reasonable upper limit. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: comedi: serial2002: tidy up multi-line commentsH Hartley Sweeten
Format the multi-line comments in the kernel CodingStyle. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14staging: comedi: serial2002: Use monotonic clockAbhilash Jindal
Wall time obtained from do_gettimeofday is susceptible to sudden jumps due to user setting the time or due to NTP. Monotonic time is constantly increasing time better suited for comparing two timestamps. Signed-off-by: Abhilash Jindal <klock.android@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30staging: comedi: serial2002: fix Coverity "Explicit null dereference"H Hartley Sweeten
serial2002_setup_subdevices() initializes each subdevice based on the config read from the attached serial device. Part of this initialization is to setup the subdevice range_table_list for the non digital subdevices. The range_table_list is allocated only when a 'range' is passed to the functions. Each channel of the subdevice then has it's 'range' initialized and that range is added to the range_table_list. The logic of this function works but causes Coverity complain about an Explicit null dereference of the allocated 'range_table_list'. Add a check for the 'range_table_list' to quiet the Coverity issue. Reported-by: coverity (CID 1011632) Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-15Merge branch 'for-linus-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull second vfs update from Al Viro: "Now that net-next went in... Here's the next big chunk - killing ->aio_read() and ->aio_write(). There'll be one more pile today (direct_IO changes and generic_write_checks() cleanups/fixes), but I'd prefer to keep that one separate" * 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (37 commits) ->aio_read and ->aio_write removed pcm: another weird API abuse infinibad: weird APIs switched to ->write_iter() kill do_sync_read/do_sync_write fuse: use iov_iter_get_pages() for non-splice path fuse: switch to ->read_iter/->write_iter switch drivers/char/mem.c to ->read_iter/->write_iter make new_sync_{read,write}() static coredump: accept any write method switch /dev/loop to vfs_iter_write() serial2002: switch to __vfs_read/__vfs_write ashmem: use __vfs_read() export __vfs_read() autofs: switch to __vfs_write() new helper: __vfs_write() switch hugetlbfs to ->read_iter() coda: switch to ->read_iter/->write_iter ncpfs: switch to ->read_iter/->write_iter net/9p: remove (now-)unused helpers p9_client_attach(): set fid->uid correctly ...
2015-04-11serial2002: switch to __vfs_read/__vfs_writeAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-03-15Staging: comedi: Remove parentheses around right side assignmentHaneen Mohammed
Parentheses are not needed around the right hand side of an assignment. This patch remove parenthese of such occurences. Issue was detected and solved using the following coccinelle script: @rule1@ identifier x, y, z; expression E1, E2; @@ ( x = (y == z); | x = (E1 == E2); | x = -( ... -) ; ) Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: comedi: drivers/*.c: remove unnecessary blank linesH Hartley Sweeten
Blank lines are not needed before a close brace '}' or after an open brace '{'. Also remove any multiple blank lines. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03staging: comedi: drivers: replace SDF_WRITEABLE with SDF_WRITABLEH Hartley Sweeten
As indicated in the comedi.h uapi header, SDF_WRITEABLE was a spelling error in the API, SDF_WRITABLE is prefered. For aesthetics, replace all the SDF_WRITEABLE uses with SDF_WRITABLE. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-16staging: comedi: serial2000: checkpatch.pl cleanup (kmalloc_array)H Hartley Sweeten
Fix the checkpatch.pl warning: WARNING: Prefer kmalloc_array over kmalloc with multiply Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-16staging: comedi: serial2000: reduce indent level of serial2002_setup_subdevs()H Hartley Sweeten
Tidy up this function a bit to reduce the indent level. This also fixex the checkpatch.pl warning: WARNING: else is not generally useful after a break or return Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-16staging: comedi: serial2000: checkpatch.pl cleanup (missing blank line)H Hartley Sweeten
Fix the checkpatch.pl warning: WARNING: Missing a blank line after declarations Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: drivers do not need <linux/ioport.h>H Hartley Sweeten
All the ioport resources are managed by the comedi core. None of the drivers depend on <linux/ioport.h>. Remove the includes. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: don't rely on comedidev.h to include headersH Hartley Sweeten
comedidev.h is the main kernel header for comedi. Every comedi driver includes this header which then includes a number of <linux/*> headers. All the drivers need <linux/module.h> and some of them need <linux/delay.h>. The rest are not needed by any of the drivers. Remove all the includes in comedidev.h except for <linux/dma-mapping.h>, which is needed to pick up the enum dma_data_direction for the comedi_subdevice definition, and "comedi.h", which is the uapi header for comedi. Add <linux/module.h> to all the comedi drivers and <linux/delay.h> to the couple that need it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: use comedi_alloc_devpriv()H Hartley Sweeten
Use the helper function to allocate memory and set the comedi_device private data pointer. This removes the dependency on slab.h from most of the drivers so remove the global #include in comedidev.h and the local #include in some of the drivers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13staging: comedi: remove FSF address from boilerplate textH Hartley Sweeten
Addresses change... Remove the paragraph with the FSF address from all the comedi source files. Also, remove the paragraph about the finding the complete GPL in the COPYING file since it's unnecessary. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: remove unnecessary dev->board_name initializationH Hartley Sweeten
The dev->board_name is now initialized by the comedi core before calling the(*attach) or (*auto_attach) function in a driver. As long as the driver does no additional probing, it's no longer necessary initialize the board_name. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: remove #if 0'ed out codeH Hartley Sweeten
This function is not used. Just remove it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: remove pr_err() noise in serial2002_read()H Hartley Sweeten
This pr_err() is just added noise, the user can't do anything about it. Just remove it. Since this is the only pr_level() message in the driver, also remove the pr_fmt() macro. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: rename all the static functionsH Hartley Sweeten
Many of the static functions in this driver have names that could potentially clash with external symbols (tty_ioctl, tty_write, etc.). Rename all the static functions so they have a 'serial2002_' prefix to avoid any issues. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: hookup the (*open) and (*close) lastH Hartley Sweeten
For aesthetic reasons, hookup the comedi_device (*open) and (*close) functions after everything else in the attach has succeeded. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: return 0 after successful attachH Hartley Sweeten
A return value of >=0 indicates a successful attach to the comedi core. Return 0 since that is more common in the kernel. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: remove attach dev_dbg() noiseH Hartley Sweeten
This is just added noise. Remove it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: add some whitespace to the subdevice initH Hartley Sweeten
To improve the readability, add some whitespace to the subdevice init. Also, for aesthetic reasons and the help with greps, rename the (*insn_{read,write}) functions. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: don't assume the number of subdevices to detachH Hartley Sweeten
Use the number of subdevices allocated (dev->n_subdevices) in the (*detach) instead of assuming a given number. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: cleanup serial2002_setup_subdevs()H Hartley Sweeten
Define and document the bit shifts of the serial.data read from the device that is used to configure the subdevice channels. Use the new defines to tidy up the configuration process. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: split up serial_2002_open()H Hartley Sweeten
Split out the code that sets up the comedi subdevices that are attached to the serial port. There are actually two steps: 1) Read the configuration of the attached subdevices. 2) Use the configuration data to setup the comedi subdevices. Step 1 is split out as serial2002_setup_subdevs(). Step 2 is split out as serial2002_setup_subdevice(). Cleanup the split out code to remove all the extra '{ }' and indents. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: cleanup serial_read()H Hartley Sweeten
Remove the unnecessary '{ }' around the code and the extra indents in the switch(). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: cleanup tty_setspeed()H Hartley Sweeten
Rename the two local variables used to set the serial port speed and latency so thy are unique. Remove the unnecessary '{ }' around the code and the extra indents. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: factor (*poll) busy wait out of tty_read()H Hartley Sweeten
Factor the (*poll) busy wait code out of tty_read() so the indent level can be reduced and tty_read() is a bit cleaner. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08staging: comedi: serial2002: fix different address space sparse warningsH Hartley Sweeten
The struct file_operations (*read) and (*write) operations expect the buffer to be a __user space pointer. Currently the (*write) operations in this driver cause this warning: warning: incorrect type in argument 2 (different address spaces) expected char const [noderef] <asn:1>*<noident> got unsigned char [usertype] *buf And the (*read) operations cause this warning: warning: incorrect type in argument 2 (different address spaces) expected char [noderef] <asn:1>*<noident> got unsigned char *<noident> Use __force to cast the buffer to a __user pointer to suppress the warnings. Consolidate the (*read) calls into a helper function, __tty_readb(). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24staging/comedi: Use pr_ or dev_ printks in drivers/serial2002.cYAMANE Toshiaki
fixed below checkpatch warning. - WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... and added pr_fmt. Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23staging: comedi: remove inline alloc_private()H Hartley Sweeten
This inline function has a very generic name and it's only a wrapper around a simple kzalloc(). Since the inline function does not save any lines-of-code, instead of renaming it just remove it and do the kzalloc() directly. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22staging: comedi: drivers: remove remaining devpriv macrosH Hartley Sweeten
The remaining comedi drivers that still have a devpriv macro are all pretty straight forward for removing the devpriv macro. This macro relies on a local variable having a specific name. Remove its use by replacing it with a local variable where used. The inline function alloc_private(), used to kzalloc the dev->private memory, returns non-zero if there is an error. Fix all the alloc_private() calls accordingly and remove any kernel messages or obvious comments that still exist in the drivers. Leave a comment in the skel driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22staging: comedi: serial2002: remove boardinfoH Hartley Sweeten
This driver only supports a single "boardtype". Remove the unneeded boardinfo struct and its use in the driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05staging: comedi: serial2002: remove subdevice pointer mathH Hartley Sweeten
Convert the comedi_subdevice access from pointer math to array access. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: comedi: serial2002: Set range for digital inputs and outputsIan Abbott
I got an update from the original author of this driver (Anders Blomdell) to set the range table for digital input and digital output subdevices. Apply it. Cc: Anders Blomdell <anders.blomdell@control.lth.se> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18staging: comedi: change device used in dev_...() callsIan Abbott
A previous set of patches by Ravishankar Karkala Mallikarjunayya replaced a load of printk() calls with dev_info(), dev_err(), etc. Unfortunately, these used the 'struct device *hw_dev' member of 'struct comedi_device') as the first parameter of these dev_...() calls, but that pointer is usually NULL, so the kernel log messages come out a bit wrong (they contain the phrase "(NULL device *)"). Use the 'struct device *class_dev' member of 'struct comedi_device' instead for these dev_...() calls. It will be non-NULL and somewhat meaningful to users. It's also consistent with those comedi drivers that already use the class_dev member in their dev_...() calls. Some of the messages included the format "comedi%d" with the minor device number used for the "%d". This is now redundant as it will be the same as the dev_name() part of the kernel log message produced by the dev_...() calls. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12staging: comedi: propogate error code from comedi_alloc_subdevicesH Hartley Sweeten
comedi_alloc_subdevices can fail with -EINVAL or -ENOMEM. When it does fail make sure to pass the proper error code back. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbott@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12staging: comedi: export alloc_subdevices as comedi_alloc_subdevicesH Hartley Sweeten
Move the inline alloc_subdevices() function from comedidev.h to drivers.c and rename it to comedi_alloc_subdevices(). The function is large enough to warrant being an exported symbol rather than being an inline in every driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>