Commit Graph

30 Commits

Author SHA1 Message Date
Greg Kroah-Hartman f814e74c9b staging: comedi: Remove redundant license text
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-28 13:20:46 +01:00
Greg Kroah-Hartman e184e2bed8 staging: comedi: add SPDX identifiers to all greybus driver files
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-28 13:20:45 +01:00
Cheah Kok Cheong 2e4b5cd641 Staging: comedi: proc: Warn if unable to create proc entry
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 <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 15:30:21 +01:00
Cheah Kok Cheong 6bd68e29b6 Staging: comedi: proc: Add module owner
Since this is a loadable kernel module, add module ownership
to follow LKM semantics.

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-01-03 15:30:21 +01:00
Cheah Kok Cheong ec0bff06bb Staging: comedi: proc: Add __init prefix
Add __init prefix so that symbol will be discarded after
module loading.

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-01-03 15:30:21 +01:00
Cheah Kok Cheong 5f52f319cd Staging: comedi: proc: Change file permission to read only
As there's no write operation, change to read only.
Was inadvertantly switched to 0644 in commit 1f817b86d5
("comedi: Don't use create_proc_read_entry()").

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-01-03 15:30:21 +01:00
Michael Welling 89509814dc Staging: comedi: proc: title block update
Follow up patch for "STAGING: comedi: style and checkpatch fixes".
Removes the file name in the comment block per suggestions.

Signed-off-by: Michael Welling <mwelling@ieee.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 04:41:04 +00:00
Michael Welling 6f2c9efa66 STAGING: comedi: style and checkpatch fixes
Updates block comment per Documentation/CodingStyle.
Also updated due to checkpatch warnings about qouted string
after Lindent modified the spacing slightly.

Signed-off-by: Michael Welling <mwelling@ieee.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 13:04:19 -07:00
Ian Abbott 616a3548e8 staging: comedi: use refcount while reading /proc/comedi
In the seq_file 'show' handler for "/proc/comedi" - `comedi_read()` in
"comedi/proc.c",  call `comedi_dev_get_from_minor()` instead of
`comedi_dev_from_minor()` to increment the reference counter for the
`struct comedi_device` while it is being examined.  Call
`comedi_dev_put()` to decrement the reference afterwards.  Also acquire
the `attach_lock` rwsem while checking whether the device is attached.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-11 16:16:44 -08:00
Ian Abbott c383e2d6da staging: comedi: use a mutex when accessing driver list
Low-level comedi drivers registered with the comedi core by
`comedi_driver_register()` are linked together into a simple linked list
headed by the `comedi_drivers` variable and chained by the `next` member
of `struct comedi_driver`.  A driver is removed from the list by
`comedi_driver_unregister()`.  The driver list is iterated through by
`comedi_device_attach()` when the `COMEDI_DEVCONFIG` ioctl is used to
attach a "legacy" device to a driver, and is also iterated through by
`comedi_read()` in "proc.c" when reading "/proc/comedi".

There is currently no protection against items being added or removed
from the list while it is being iterated.  Add a mutex
`comedi_drivers_list_lock` to be locked while adding or removing an item
on the list, or when iterating through the list.

`comedi_driver_unregister()` also checks for and detaches any devices
using the driver.  This is currently done before unlinking the driver
from the list, but it makes more sense to unlink the driver from the
list first to prevent `comedi_device_attach()` attempting to use it, so
move the unlinking part to the start of the function.  Also, in
`comedi_device_attach()` hold on to the mutex until we've finished
attempting to attach the device to avoid it interfering with the
detachment in `comedi_driver_unregister()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23 14:22:29 -07:00
H Hartley Sweeten 641f064e5d staging: comedi: remove FSF address from boilerplate text
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-05-13 17:34:22 -04:00
Al Viro bae301d346 staging: single_open() leaks
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-05 00:15:43 -04:00
David Howells 1f817b86d5 comedi: Don't use create_proc_read_entry()
Don't use create_proc_read_entry() as that is deprecated, but rather use
proc_create_data() and seq_file instead.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: David Schleef <ds@schleef.org>
cc: Ian Abbott <abbotti@mev.co.uk>
cc: Mori Hess <fmhess@users.sourceforge.net>
cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: H Hartley Sweeten <hsweeten@visionengravers.com>
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:51 -04:00
Al Viro e784788ddb get rid of a bunch of open-coded create_proc_read_entry()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:10 -04:00
H Hartley Sweeten fd958f7eb4 staging: comedi: Makefile: conditionally compile multi-file core module
Instead of using the #ifdef'ery in the comedi_compat32.c and proc.c
files to include/exclude them from the comedi core, modify the Makefile
to include those files automatically when enabled in the .config.

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-01-07 14:51:11 -08:00
H Hartley Sweeten 4da5fa9a43 staging: comedi: use comedi_dev_from_minor()
Remove the need to export comedi_get_device_file_info() by using the
new helper comedi_dev_from_minor(). This will also allow us to make
the comedi_device_file_info struct private.

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-01-07 14:25:46 -08:00
H Hartley Sweeten 1b6c710e2a staging: comedi: remove unnecessary '#define __NO_VERSION__'
This define is no longer required for multi-file modules.

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-11-27 09:16:38 -08:00
Ian Abbott f286766e4b staging: comedi: remove comedi_fops.h
Move the contents of "comedi_fops.h" into "comedi_internal.h" and delete
"comedi_fops.h". It only contains a couple of external variable
declarations (and #include <linux/types.h>) and one of those isn't even
declared in "comedi_fops.c".  The other one is an external declaration
of a variable used to store a module parameter and some of those are
already externally declared in "comedi_internal.h", so they can keep it
company!

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20 12:56:55 -07:00
Greg Kroah-Hartman 22d114248b Staging: comedi: clean up sparse issues in proc.c
The whole file should be converted to use seqfile, if it's even
still needed.  Or move to debugfs.

Anyway, I fixed up the minor issues here.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:36:03 -07:00
Greg Kroah-Hartman dc1da7f7ba Staging: comedi: fix up remaining coding style issue in proc.c
Move the external variable into a .h file, where it belongs.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:58 -07:00
Greg Kroah-Hartman 8e81f184d9 Staging: comedi: fix up coding issues in proc.c
Fixes all but one.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:58 -07:00
Mithlesh Thukral 0a85b6f0ab Staging: Comedi: Lindent changes to comdi driver in staging tree
Lindent changes to comdi driver in staging tree.
This patch is followed by the checkpatch.pl error fixes.
Did not make them part of this patch as the patch size is already huge.

Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:33 -07:00
Bill Pemberton 139dfbdfac Staging: comedi: Remove comedi_driver typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:56 -07:00
Bill Pemberton 71b5f4f119 Staging: comedi: Remove comedi_device typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:56 -07:00
Bill Pemberton 82675f3547 Staging: comedi: Remove curly braces where they are not needed
Changes as suggested by checkpatch.pl.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:54 -07:00
Bill Pemberton c7427409cd Staging: comedi: Move trailing statements to next line as requested by checkpatch
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:54 -07:00
Bill Pemberton 6a98d36e87 Staging: comedi: Add spaces around parens as requested by checkpatch.pl
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:54 -07:00
Bill Pemberton b6c777571b Staging: comedi: Convert C99 style comments to traditional style comments
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:53 -07:00
J.R. Mauro a8275fcaa7 Staging: comedi: fix build if CONFIG_PROC_FS is not set
Don't include procfs functions if CONFIG_PROC_FS is not set

Signed-off by: J.R. Mauro <jrm8005@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-06 13:52:27 -08:00
David Schleef ed9eccbe89 Staging: add comedi core
This adds the Comedi core to the staging tree.
This is a data acquision infrastructure for Linux, providing a common
interface for these types of drivers.

Taken directly from the comedi git tree, with only minor tweaks
by Greg to get it to build properly within the kernel tree.

From: David Schleef <ds@schleef.org>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-06 13:52:16 -08:00