Re: [PATCH v2] Staging: comedi: drivers: comedi_test: Add auto-configuration capability

2017-02-15 Thread Cheah Kok Cheong
On Mon, Feb 13, 2017 at 11:14:14AM +, Ian Abbott wrote: > On 11/02/17 10:37, Cheah Kok Cheong wrote: > >+static int __init comedi_test_init(void) > >+{ > >+int ret; > >+ > >+ret = comedi_driver_register(&waveform_driver); > >+if (ret) {

Re: [PATCH v2] Staging: comedi: drivers: comedi_test: Add auto-configuration capability

2017-02-16 Thread Cheah Kok Cheong
On Thu, Feb 16, 2017 at 10:10:34AM +, Ian Abbott wrote: > On 15/02/17 06:05, Cheah Kok Cheong wrote: > >On Mon, Feb 13, 2017 at 11:14:14AM +, Ian Abbott wrote: > >>On 11/02/17 10:37, Cheah Kok Cheong wrote: > [snip] > >>>+static

[PATCH v3] Staging: comedi: drivers: comedi_test: Add auto-configuration capability

2017-02-16 Thread Cheah Kok Cheong
bility will broaden the test function of this module. Hopefully this will make it easier for people to check out the COMEDI system and contribute to its development. Signed-off-by: Cheah Kok Cheong --- V3: -Ensure struct class and struct device pointers are "NULL" if auto-configuration f

[PATCH] Staging: comedi: drivers: comedi_test: Avoid multiple line dereference

2017-02-20 Thread Cheah Kok Cheong
Fix checkpatch warning "Avoid multiple line dereference" using a local variable to avoid line wrap. Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/drivers/comedi_test.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/come

Re: [PATCH] Staging: comedi: drivers: comedi_test: Avoid multiple line dereference

2017-02-20 Thread Cheah Kok Cheong
On Mon, Feb 20, 2017 at 10:03:39AM +, Ian Abbott wrote: > On 20/02/17 08:28, Cheah Kok Cheong wrote: > >Fix checkpatch warning "Avoid multiple line dereference" > >using a local variable to avoid line wrap. > > > >Signed-off-by: Cheah Kok Cheong >

Re: [PATCH] Staging: comedi: drivers: comedi_test: Avoid multiple line dereference

2017-02-21 Thread Cheah Kok Cheong
On Mon, Feb 20, 2017 at 05:36:52PM +, Ian Abbott wrote: > On 20/02/17 16:02, Cheah Kok Cheong wrote: > >On Mon, Feb 20, 2017 at 10:03:39AM +, Ian Abbott wrote: > >>On 20/02/17 08:28, Cheah Kok Cheong wrote: > >>>Fix checkpatch warning "Avoid multiple l

Re: [PATCH] Staging: comedi: drivers: comedi_test: Avoid multiple line dereference

2017-02-21 Thread Cheah Kok Cheong
On Tue, Feb 21, 2017 at 11:20:08AM +0100, Valentin Rothberg wrote: > On Feb 21 '17 10:12, Ian Abbott wrote: > > On 21/02/2017 09:33, Cheah Kok Cheong wrote: > > > On Mon, Feb 20, 2017 at 05:36:52PM +, Ian Abbott wrote: > > > > On 20/02/17 16:02, Cheah Kok Che

[PATCH v2] Staging: comedi: drivers: comedi_test: Avoid multiple line dereference

2017-02-21 Thread Cheah Kok Cheong
Fix checkpatch warning "Avoid multiple line dereference" using a pointer variable to avoid line wrap. Signed-off-by: Cheah Kok Cheong --- V2: -Use pointer instead of normal variable - Ian -Variable is to be used as "write destination" and not as "read source"

[PATCH 1/2] Staging: comedi: comedi_fops: Change comedi_num_legacy_minors type

2017-03-04 Thread Cheah Kok Cheong
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 --- drivers/staging/comedi/comedi_fops.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a

[PATCH 2/2] Staging: comedi: comedi_fops: Fix "out of minor numbers for board device files"

2017-03-04 Thread Cheah Kok Cheong
dware_device(). Fix: commit 38b9722a4414 ("staging: comedi: avoid releasing legacy minors automatically") Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/comedi_fops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fo

[PATCH v2 1/2] Staging: comedi: comedi_fops: Change comedi_num_legacy_minors type

2017-03-07 Thread Cheah Kok Cheong
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 --- V2: -No changes. drivers/staging/comedi/comedi_fops.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions

[PATCH v2 2/2] Staging: comedi: comedi_fops: Fix "out of minor numbers for board device files"

2017-03-07 Thread Cheah Kok Cheong
his goes for a simple fix which limit comedi_num_legacy_minors to 47 instead of tinkering with comedi_alloc_board_minor() and comedi_release_hardware_device(). Fix: commit 38b9722a4414 ("staging: comedi: avoid releasing legacy minors automatically") Signed-off-by: Cheah Kok Cheong --

Re: [PATCH 1/2] Staging: comedi: comedi_fops: Change comedi_num_legacy_minors type

2017-03-08 Thread Cheah Kok Cheong
Dear Greg, Thanks for taking the time to review. On Tue, Mar 07, 2017 at 08:01:38PM +0100, Greg KH wrote: > On Sun, Mar 05, 2017 at 03:22:32AM +0800, Cheah Kok Cheong wrote: > > Change to unsigned to allow removal of negative value check in > > init section. > > Why? >

Re: [PATCH 2/2] Staging: comedi: comedi_fops: Fix "out of minor numbers for board device files"

2017-03-08 Thread Cheah Kok Cheong
Dear Dan, Thanks for reviewing this patch. On Wed, Mar 08, 2017 at 08:54:47AM +0300, Dan Carpenter wrote: > On Sun, Mar 05, 2017 at 03:22:33AM +0800, Cheah Kok Cheong wrote: > > If comedi module is loaded with the following max allowed parameter > > [comedi_num_legacy_minors=

Re: [PATCH 1/2] Staging: comedi: comedi_fops: Change comedi_num_legacy_minors type

2017-03-08 Thread Cheah Kok Cheong
On Wed, Mar 08, 2017 at 10:45:26AM +0100, Greg KH wrote: > On Wed, Mar 08, 2017 at 05:38:12PM +0800, Cheah Kok Cheong wrote: > > Dear Greg, > > Thanks for taking the time to review. > > > > On Tue, Mar 07, 2017 at 08:01:38PM +0100, Greg KH wrote: > > > On S

Re: [PATCH 2/2] Staging: comedi: comedi_fops: Fix "out of minor numbers for board device files"

2017-03-08 Thread Cheah Kok Cheong
Dear Ian, Thanks for taking the trouble to reply. On Wed, Mar 08, 2017 at 11:13:49AM +, Ian Abbott wrote: > On 08/03/17 10:08, Cheah Kok Cheong wrote: > >Dear Dan, > > Thanks for reviewing this patch. > > > >On Wed, Mar 08, 2017 at 08:54:47AM +0300, Dan Carpente

Re: [PATCH v2 2/2] Staging: comedi: comedi_fops: Fix "out of minor numbers for board device files"

2017-03-08 Thread Cheah Kok Cheong
Dear Ian, Thanks for taking the time to reply. On Wed, Mar 08, 2017 at 12:36:41PM +, Ian Abbott wrote: > On 07/03/17 18:13, Cheah Kok Cheong wrote: > >If comedi module is loaded with the following max allowed parameter > >[comedi_num_legacy_minors=48], subsequent loa

[PATCH] Staging: comedi: kcomedilib: Add module_init/exit function

2016-12-05 Thread Cheah Kok Cheong
Add init/exit function to follow LKM semantics. Apparently this module can still load/unload without the init/exit function. Tested loading/unloading with and without this patch. Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/kcomedilib/kcomedilib_main.c | 12 1 file

[PATCH] Staging: comedi: comedidev.h: Drop old style zero-length array

2016-12-21 Thread Cheah Kok Cheong
According to Documentation/Changes, the minimum gcc version required to compile the kernel is 3.2 (this is probably outdated too). Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/comedidev.h | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/staging

[PATCH 0/5] Staging: comedi: Proc FS related cleanup

2016-12-30 Thread Cheah Kok Cheong
This series does trivial cleanup for COMEDI proc fs related stuff. Cheah Kok Cheong (5): Staging: comedi: comedi_fops: Avoid orphaned proc entry Staging: comedi: proc: Change file permission to read only Staging: comedi: proc: Add __init prefix Staging: comedi: proc: Add module owner

[PATCH 1/5] Staging: comedi: comedi_fops: Avoid orphaned proc entry

2016-12-30 Thread Cheah Kok Cheong
Move comedi_proc_init to the end to avoid orphaned proc entry if module loading failed. Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/comedi_fops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging

[PATCH 2/5] Staging: comedi: proc: Change file permission to read only

2016-12-30 Thread Cheah Kok Cheong
As there's no write operation, change to read only. Was inadvertantly switched to 0644 in commit 1f817b86d5e6 ("comedi: Don't use create_proc_read_entry()"). Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH 3/5] Staging: comedi: proc: Add __init prefix

2016-12-30 Thread Cheah Kok Cheong
Add __init prefix so that symbol will be discarded after module loading. Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/proc.c b/drivers/staging/comedi/proc.c index 3513f4c..6d13b51

[PATCH 4/5] Staging: comedi: proc: Add module owner

2016-12-30 Thread Cheah Kok Cheong
Since this is a loadable kernel module, add module ownership to follow LKM semantics. Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/proc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/proc.c b/drivers/staging/comedi/proc.c index 6d13b51..99b23b2e

[PATCH 5/5] Staging: comedi: proc: Warn if unable to create proc entry

2016-12-30 Thread Cheah Kok Cheong
The proc entry is not essential for the comedi system as evident by the support for !CONFIG_PROC_FS. So for failure to create, just warn and continue loading. Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[PATCH 4/4] Staging: comedi: comedi_fops: Remove unused stat.h header

2017-01-07 Thread Cheah Kok Cheong
Unused after commit 6e3029397698 ("staging: comedi: comedi_fops: coding style fixes") - Fixed coding style in comedi_fops.c Symbolic to octal permission. Anyway it's included in module.h Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/comedi_fops.c | 1 - 1 file chan

[PATCH 0/4] Staging: comedi: comedi_fops: Header cleanup

2017-01-07 Thread Cheah Kok Cheong
This series does trivial header cleanup for comedi_fops.c Cheah Kok Cheong (4): Staging: comedi: comedi_fops: Remove unused kmod.h header Staging: comedi: comedi_fops: Remove redundant init.h header Staging: comedi: comedi_fops: Remove unused vmalloc.h header Staging: comedi: comedi_fops

[PATCH 3/4] Staging: comedi: comedi_fops: Remove unused vmalloc.h header

2017-01-07 Thread Cheah Kok Cheong
Unused after commit d18431325be0 ("staging: comedi: deprecate loading firmware with comedi_config"). Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/comedi_fops.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/stag

[PATCH 1/4] Staging: comedi: comedi_fops: Remove unused kmod.h header

2017-01-07 Thread Cheah Kok Cheong
Unused after commit f30f2c2d417b ("staging: comedi: remove check for CONFIG_KMOD"). Anyway it's included in module.h Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/comedi_fops.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fo

[PATCH 2/4] Staging: comedi: comedi_fops: Remove redundant init.h header

2017-01-07 Thread Cheah Kok Cheong
After commit 0fd972a7d91d ("module: relocate module_init from init.h to module.h"), including module.h will do and init.h is also thrown in. Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/comedi_fops.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/stag

[PATCH] Staging: comedi: drivers: comedi_test: Add auto-configuration capability

2017-01-25 Thread Cheah Kok Cheong
al configuration capability will broaden the test function of this module. Hopefully this will make it easier for people to check out the COMEDI system and contribute to its development. Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/drivers/comedi_test.c | 140 +++

[PATCH] Staging: comedi: drivers: comedi_test: Set max input value for auto config

2017-01-27 Thread Cheah Kok Cheong
rwise then maybe this can be looked at separately. Signed-off-by: Cheah Kok Cheong --- Note: This patch is dependent upon an earlier pending patch. [Staging: comedi: drivers: comedi_test: Add auto-configuration capability] drivers/staging/comedi/drivers/comedi_test.c | 8 1 file chang

Re: [PATCH] Staging: comedi: drivers: comedi_test: Add auto-configuration capability

2017-02-08 Thread Cheah Kok Cheong
On Thu, Jan 26, 2017 at 01:31:29AM +0800, Cheah Kok Cheong wrote: > Currently this module needs to be manually configured by COMEDI > userspace tool before the test waveform can be read by a COMEDI > compatible application. > > This patch adds auto-configuration capability a

Re: [PATCH] Staging: comedi: drivers: comedi_test: Add auto-configuration capability

2017-02-11 Thread Cheah Kok Cheong
Dear Ian, Thank you for taking the trouble to review this. On Thu, Feb 09, 2017 at 12:25:15PM +, Ian Abbott wrote: > > I think the "manual" parameter is misnamed, since this parameter controls > whether a dummy hardware device is created by the driver or not. Reserved > COMEDI devices can

Re: [PATCH] Staging: comedi: drivers: comedi_test: Set max input value for auto config

2017-02-11 Thread Cheah Kok Cheong
On Thu, Feb 09, 2017 at 12:28:42PM +, Ian Abbott wrote: > On 27/01/17 15:55, Cheah Kok Cheong wrote: > >Currently user can input any value for amplitude and period. > >This patch set a sane max value for auto-configuration mode. > > > >For manual configuration mode,

[PATCH v2] Staging: comedi: drivers: comedi_test: Add auto-configuration capability

2017-02-11 Thread Cheah Kok Cheong
bility will broaden the test function of this module. Hopefully this will make it easier for people to check out the COMEDI system and contribute to its development. Signed-off-by: Cheah Kok Cheong --- V2: -Rename module param - Ian -Rename class - Ian -Tidy up init error handling - Ian -Al

[PATCH] staging: comedi: drivers: replace le16_to_cpu() with usb_endpoint_maxp()

2016-07-22 Thread Cheah Kok Cheong
Use macro introduced in commit 939f325f4a0f ("usb: add usb_endpoint_maxp() macro") Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/drivers/dt9812.c | 4 ++-- drivers/staging/comedi/drivers/ni_usb6501.c | 4 ++-- drivers/staging/comedi/drivers/vmk80xx.c| 12 +