aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
AgeCommit message (Collapse)AuthorFilesLines
2017-10-18staging: comedi: adv_pci_dio: update for PCI-1761Gravatar Anton Dozenko 2-4/+26
Advantech PCI-1761 device support to the driver adv_pci_dio has been added. Patch has been successfully tested on a real card (8 digital outs, 8 digital inputs). Signed-off-by: Anton Dozenko <anton.dozenko@gmail.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18staging: comedi: dt282x: fix IRQ assignment for dev->irq.Gravatar Arvind Yadav 1-0/+2
Here, dev->irq is not assigned with irq. comedi_legacy_detach() is using dev->irq for release irq and dt282x_attach() is using dev->irq for initialize comedi_subdevice. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18staging: comedi: s526: mark expected switch fall-throughGravatar Gustavo A. R. Silva 1-3/+2
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18staging/comedi: Convert timers to use timer_setup()Gravatar Kees Cook 3-17/+22
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Adds pointer back to comedi device from private struct. Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: devel@driverdev.osuosl.org Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-22staging/comedi/das16: Make timer initialization unconditionalGravatar Kees Cook 1-6/+4
With timer initialization made unconditional, there is no reason to make del_timer_sync() calls conditionally, there by removing the test of the .data field. Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: devel@driverdev.osuosl.org Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-14Merge branch 'work.set_fs' of ↵Gravatar Linus Torvalds 1-19/+5
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull more set_fs removal from Al Viro: "Christoph's 'use kernel_read and friends rather than open-coding set_fs()' series" * 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs: unexport vfs_readv and vfs_writev fs: unexport vfs_read and vfs_write fs: unexport __vfs_read/__vfs_write lustre: switch to kernel_write gadget/f_mass_storage: stop messing with the address limit mconsole: switch to kernel_read btrfs: switch write_buf to kernel_write net/9p: switch p9_fd_read to kernel_write mm/nommu: switch do_mmap_private to kernel_read serial2002: switch serial2002_tty_write to kernel_{read/write} fs: make the buf argument to __kernel_write a void pointer fs: fix kernel_write prototype fs: fix kernel_read prototype fs: move kernel_read to fs/read_write.c fs: move kernel_write to fs/read_write.c autofs4: switch autofs4_write to __kernel_write ashmem: switch to ->read_iter
2017-09-04serial2002: switch serial2002_tty_write to kernel_{read/write}Gravatar Christoph Hellwig 1-19/+5
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>
2017-08-29staging: comedi: coding style fixes found by checkpatch.plGravatar Simo Koskinen 1-2/+2
The patch removes "WARNING: Prefer using '"%s...", __func__' to using 'xxxxxxxx', this function's name, in a string" warnings reported by checkpatch.pl script. Signed-off-by: Simo Koskinen <koskisoft@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-23Staging: comedi: comedi_fops: fix dev_err() warning styleGravatar Bryan Garza 1-1/+1
Changed dev_err() call to use function name constant instead of hardcoded string. Issue found by checkpatch. Signed-off-by: Bryan Garza <bry@riseup.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-14Merge 4.13-rc5 into staging-nextGravatar Greg Kroah-Hartman 1-0/+3
We need it here for iio fixes. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-30staging: comedi: comedi_fops: do not call blocking ops when !TASK_RUNNINGGravatar Ian Abbott 1-0/+3
Comedi's read and write file operation handlers (`comedi_read()` and `comedi_write()`) currently call `copy_to_user()` or `copy_from_user()` whilst in the `TASK_INTERRUPTIBLE` state, which falls foul of the `might_fault()` checks when enabled. Fix it by setting the current task state back to `TASK_RUNNING` a bit earlier before calling these functions. Reported-by: Piotr Gregor <piotrgregor@rsyncme.org> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: <stable@vger.kernel.org> # 4.5+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-30staging: comedi: ni_mio_common.c: fix coding style issueGravatar Christopher Mårtensson 1-1/+2
"checkpatch.pl -f ..." gave ERROR: open brace '{' following function definitions go on the next line Signed-off-by: Christopher Mårtensson <cribalik@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-23Merge 4.13-rc2 into staging-nextGravatar Greg Kroah-Hartman 1-2/+1
This resolves a merge issue and gets the vmbox drm driver into this branch to be able to start taking fixes for it... Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-16staging: comedi: ni_mio_common: fix AO timer off-by-one regressionGravatar Ian Abbott 1-2/+1
As reported by Éric Piel on the Comedi mailing list (see <https://groups.google.com/forum/#!topic/comedi_list/ueZiR7vTLOU/discussion>), the analog output asynchronous commands are running too fast with a period 50 ns shorter than it should be. This affects all boards with AO command support that are supported by the "ni_pcimio", "ni_atmio", and "ni_mio_cs" drivers. This is a regression bug introduced by commit 080e6795cba3 ("staging: comedi: ni_mio_common: Cleans up/clarifies ni_ao_cmd"), specifically, this line in `ni_ao_cmd_set_update()`: /* following line: N-1 per STC */ ni_stc_writel(dev, trigvar - 1, NISTC_AO_UI_LOADA_REG); The `trigvar` variable value comes from a call to `ni_ns_to_timer()` which converts a timer period in nanoseconds to a hardware divisor value. The function already reduces the divisor by 1 as required by the hardware, so the above line should not reduce it further by 1. Fix it by replacing `trigvar` by `trigvar - 1` in the above line, and remove the misleading comment. Reported-by: Éric Piel <piel@delmic.com> Fixes: 080e6795cba3 ("staging: comedi: ni_mio_common: Cleans up/clarifies ni_ao_cmd") Cc: Éric Piel <piel@delmic.com> Cc: Spencer E. Olson <olsonse@umich.edu> Cc: <stable@vger.kernel.org> # 4.7+ Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-16staging: comedi: Use offset_in_page macroGravatar Amitoj Kaur Chawla 1-1/+1
Use offset_in_page macro instead of (var & ~PAGE_MASK) The Coccinelle semantic patch used to make this change is as follows: // <smpl> @@ unsigned long p; @@ - p & ~PAGE_MASK + offset_in_page(p) // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-24staging: comedi: use centralized error clean-up in comedi_init()Gravatar Ian Abbott 1-21/+22
Centralize the "clean-up on error" handling in `comedi_init()` using `goto` statements. Also change some of the explicit `-EIO` return values to the error return values from the failing functions as there is no good reason to use `-EIO` explicitly. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-24staging: comedi: fix clean-up of comedi_class in comedi_init()Gravatar Ian Abbott 1-0/+1
There is a clean-up bug in the core comedi module initialization functions, `comedi_init()`. If the `comedi_num_legacy_minors` module parameter is non-zero (and valid), it creates that many "legacy" devices and registers them in SysFS. A failure causes the function to clean up and return an error. Unfortunately, it fails to destroy the "comedi" class that was created earlier. Fix it by adding a call to `class_destroy(comedi_class)` at the appropriate place in the clean-up sequence. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: <stable@vger.kernel.org> # 3.9+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13Staging: comedi: ni_labpc_regs: fixed a block comment alignment issueGravatar Amisha Singh 1-1/+1
Fixed a coding style issue. Signed-off-by: Amisha Singh <amisha.sh22@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06staging: comedi: ni_labpc_isadma: fixed a comment coding style issueGravatar Adrian Stanciu 1-1/+1
Fixed a BLOCK_COMMENT_STYLE warning reported by checkpatch.pl script. Signed-off-by: Adrian Stanciu <adrian.stanciu.pub@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04Staging: comedi: s626.c: fixed trailing */ style issueGravatar edcarter 1-3/+6
Fixed coding style issue where trailing */ in block comments were not on separate lines. Signed-off-by: Elias Carter <edcarter@ualberta.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-25staging: comedi: addi_apci_3xxx: check return valueGravatar Pan Bian 1-0/+2
Function pci_ioremap_bar() will return a NULL pointer if there is no enough memory. However, in function apci3xxx_auto_attach(), the return value of function pci_ioremap_bar() is not validated. This may result in NULL dereference in following access to dev->mmio. This patch fixes the bug. Signed-off-by: Pan Bian <bianpan2016@163.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-25staging: comedi: support vm_access_process for mmap'd bufferGravatar Ian Abbott 3-0/+41
If a process that has mmap'd a COMEDI buffer is being run under a debugger such as GDB, the buffer contents are inaccessible from the debugger. Support the `access()` VM operation to allow the buffer contents to be accessed by another process. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: comedi: drivers: s626.c - fixed checkpatch issue about data typeGravatar Andrea della Porta 1-1/+1
staging: comedi: drivers: s626.c - fixed the following checkpatch issue: CHECK: Prefer kernel type 's16' over 'int16_t' #1939: FILE: drivers/staging/comedi/drivers/s626.c:1939: + int16_t dacdata = (int16_t)data[i]; Signed-off-by: Andrea della Porta <sfaragnaus@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: comedi: amplc_pci224: convert CLK_CONFIG() macro to functionGravatar Ian Abbott 1-4/+9
Convert the `CLK_CLKFIG(chan, src)` macro to a static function `pci224_clk_config(chan, src)`. This is consistent with an earlier change to convert `GAT_CONFIG(chan, src)` to a static function. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: comedi: amplc_pci224: remove 'inline' from pci224_gat_config()Gravatar Ian Abbott 1-2/+1
Let the compiler figure out whether `pci224_gat_confip()` should be inlined by itself. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: comedi: amplc_pci230: convert CLK_CONFIG() macro to functionGravatar Ian Abbott 1-3/+6
Convert the `CLK_CONFIG(chan, src)` macro to a static function `pci230_clk_config(chan, src)`. This is consistent with an earlier change to convert `GAT_CONFIG(chan, src)` to a static function. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: comedi: amplc_pci230: remove 'inline' from pci230_gat_config()Gravatar Ian Abbott 1-2/+1
Let the compiler figure out whether `pci230_gat_config()` should be inlined by itself. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: comedi: labpc: fix isadma dependencyGravatar Arnd Bergmann 1-1/+3
When COMEDI_NI_LABPC is built-in and COMEDI_NI_LABPC_ISA is a loadable module, thhe ISA DMA code is not reachable by the common module, causing a link error: drivers/staging/built-in.o: In function `labpc_interrupt': ni_labpc_common.c:(.text+0x1d178): undefined reference to `labpc_handle_dma_status' ni_labpc_common.c:(.text+0x1d1cb): undefined reference to `labpc_drain_dma' drivers/staging/built-in.o: In function `labpc_ai_cmd': ni_labpc_common.c:(.text+0x1d8ad): undefined reference to `labpc_setup_dma' This changes the definition of COMEDI_NI_LABPC_ISADMA so that it will also be builtin for that case. This looks like a rather old bug, but I have never seen this in randconfig testing until today. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14staging: comedi: amplc_pci224: Convert macro GAT_CONFIG to static inline ↵Gravatar simran singhal 1-4/+8
function Convert macro GAT_CONFIG to static inline function as static inline functions are preferred over macros. This change is possible since the arguments at all call sites have the same type. The uses were updated with Coccinelle: @r1@ expression dev,reg,chan,src; @@ -GAT_CONFIG(chan, src) +pci224_gat_config(chan, src) Also, the comment describing the macro has been removed. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14staging: comedi: Compress return logic into one line.Gravatar Varsha Rao 1-3/+1
Simplify function return by merging assignment and return into a single line. The following coccinelle script is used to fix this issue. @@ expression e; local idexpression ret; @@ -ret = e; -return ret; +return e; Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: comedi: jr3_pci: change module descriptionGravatar Ian Abbott 1-1/+1
Change the MODULE_DESCRIPTION string from the generic "Comedi low-level driver" to the more specific "Comedi driver for JR3/PCI force sensor board". Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: comedi: jr3_pci: fix initial range[8] max valueGravatar Ian Abbott 1-1/+1
`jr3_pci_alloc_spriv()` initializes `spriv->range[8]` to use a maximum value of 65536, but that will be overwritten with 65535 at a later time by `jr3_pci_poll_subdevice()` once the "set full scales" command is complete. The initial setting looks like a mistake. This range is only associated with a couple of dummy channels (channels 56 and 57) to read back the model number and serial number, so no user code should be attempting to convert those numbers to physical units. Just change the initial value to 65535 to match the final value. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: comedi: jr3_pci: check PCI BAR 0 sizeGravatar Ian Abbott 1-0/+3
The various supported boards have different numbers of subdevices from 1 to 4. Each subdevice needs a block of registers in PCI BAR 0. Check the region is large enough for the required number of subdevices. Return an error from `jr3_pci_auto_attach()` if it is too small. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: comedi: jr3_pci: check sizes at compile timeGravatar Ian Abbott 1-6/+1
The driver currently checks the size of `struct jr3_sensor` is correct when a device is attached, returning an error if it is wrong. Replace that with a compile-time check. We don't care too much about the size of `struct jr3_sensor` as it is embedded in the larger `struct jr3_block` and is followed by a lot of padding. We should care more that the size of `struct jr3_block` is correct, as it describes the overall register layout of a block, and there is an array of such blocks (one per subdevice). Check its size at compile-time using the `BUILD_BUG_ON()` macro. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: comedi: jr3_pci: omit pointless debug infoGravatar Ian Abbott 1-7/+2
`jr3_pci_open()` outputs several debug log messages containing serial numbers of the sensors (one per subdevice) along with a pointer to the subdevice private data structure. The latter is of no use, so reformat the debug log to omit it. `jr3_pci_alloc_spriv()` outputs a debug log message containing more useless information about the remapped base address of the board registers, the sensor registers, and the difference between them. Get rid of it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: comedi: jr3_pci: use struct jr3_block instead of jr3_tGravatar Ian Abbott 2-16/+12
`struct jr3_t` contains a single array member `block` of member type `struct jr3_block`. Rather than using pointers to `struct jr3_t`, just use pointers to `struct jr3_block` instead and treat it as an array. Replace the local variables `struct jr3_t __iomem *iobase` with `struct jr3_block __iomem *block`. Remove the definition of `struct jr3_t` as it is no longer needed. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: comedi: jr3_pci: separate out block typeGravatar Ian Abbott 1-8/+10
`struct jr3_t` contains a single array member `block` of a tag-less `struct` type. Rename the tag-less `struct` type to `struct jr3_block` and move its definition outside of `struct jr3_t`. This will allow us to use pointers of this type. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: comedi: jr3_pci: rename 'channel' to 'block'Gravatar Ian Abbott 2-6/+6
The term "channel" is overloaded in this driver. Rename the `channel` member of `struct jr3_t` to `block` to reduce confusion. `block` is an array of an anonymous `struct` type, with each element covering the registers for one subdevice. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: comedi: jr3_pci: rename data to sensorGravatar Ian Abbott 2-6/+6
Rename the `channel[x].data` member of `struct jr3_t` to `channel[x].sensor` to match its type `struct jr3_sensor`. Also rename local variable `ch0data` in `jr3_pci_show_copyright()` to `sensor0` for consistency. It points to the `struct jr3_sensor` embedded in the registers for "channel" 0. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: comedi: jr3_pci: rename channel to sensorGravatar Ian Abbott 1-77/+75
The driver overloads the term "channel" a lot. To help reduce confusion, rename the `channel` member of `struct jr3_pci_subdev_private` to `sensor` as it points to a `struct jr3_sensor`. Also rename the various function parameters and local variables called `channel` that point to a `struct jr3_sensor` to `sensor`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12staging: comedi: jr3_pci: rename struct jr3_channel to jr3_sensorGravatar Ian Abbott 2-16/+16
The driver overloads the term "channel" a lot. To help reduce confusion, rename `struct jr3_channel` to `struct jr3_sensor`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: comedi: Remove useless cast.Gravatar Varsha Rao 1-1/+1
Variable dac_data is already declared as of type u8. Again explicit type casting of dac_data to u8, is not required. Hence this patch removes it by using the following coccinelle script. @@ type T; T *ptr; T p; @@ ( - (T *)(&p) + &p | - (T *)ptr + ptr | - (T *)(ptr) + ptr | - (T)(p) + p ) Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: comedi: ni_atmio: make device_ids constGravatar Ian Abbott 1-1/+1
The `device_ids[]` passed to `MODULE_DEVICE_TABLE()` should be `const`. When the "ni_atmio" driver is built-in, gcc warns about `device_ids` being defined but ununsed. Make it `const`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: comedi: allow it to be built-inGravatar Ian Abbott 1-1/+0
There is no particular reason why comedi has to be built as kernel modules. Remove the `depends on m` from the Kconfig file to allow it to be built-in. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09Staging: comedi: comedi_fops: Change comedi_num_legacy_minors typeGravatar Cheah Kok Cheong 1-4/+3
Change to unsigned to allow removal of negative value check in init section. Use smaller data type since the max possible value currently is 48. Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-07staging: comedi: Replace "is is" with "is"Gravatar simran singhal 1-1/+1
This patch replace "is is " with "is". The replacement couldn't be automated because sometimes the first "is" was meant to be another word. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06Staging: comedi: drivers: comedi_test: Avoid multiple line dereferenceGravatar Cheah Kok Cheong 1-4/+4
Fix checkpatch warning "Avoid multiple line dereference" using a pointer variable to avoid line wrap. Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: comedi: Using macro DIV_ROUND_UPGravatar simran singhal 2-2/+2
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)). It clarifies the divisor calculations. This occurence was detected using the coccinelle script: @@ expression e1; expression e2; @@ ( - ((e1) + e2 - 1) / (e2) + DIV_ROUND_UP(e1,e2) | - ((e1) + (e2 - 1)) / (e2) + DIV_ROUND_UP(e1,e2) ) Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: comedi: s626: Kernel doc format commentsGravatar Tobin C. Harding 1-19/+27
Checkpatch emits WARNING: Block comments use a trailing */ on a separate line. Offending comments are commenting variables within the main data structure of s626 driver. We can move these comments to kernel doc format with the benefit of clearing the warning and improving the documentation for the driver. Remove comments on structure members. Add original comments to the head of the structure definition in kernel doc format. Signed-off-by: Tobin C. Harding <me@tobin.cc> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: comedi: jr3_pci: replace devpriv->iobase with dev->mmioGravatar Ian Abbott 1-17/+15
The "jr3_pci" driver currently uses the `iobase` member of its private device data `struct jr3_pci_dev_private` to store a pointer to its ioremapped register region. Use the `mmio` member of the `struct comedi_device` to store this instead, and remove the `iobase` member. The `iobase` member was of type `struct jr3_t __iomem *`, with the board's complicated register layout described by `struct jr3_t`. The `mmio` member is a generic `void __iomem *`, so its value needs converting to a `struct jr3_t __iomem *` for our purposes. Change the clean-up in `jr3_pci_detach()` to call `comedi_pci_detach()` instead of `comedi_pci_disable()`, as that will iounmap `dev->mmio` for us. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>