Commit graph

53 commits

Author SHA1 Message Date
Stefan Hajnoczi 09fda10a0e staging: line6: drop dump requests from pod startup
The pod startup procedure dumps model data.  This is no longer useful
since the sysfs attrs which expose this information to userspace have
been removed.  The dump request wasn't been processed anymore.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:13:51 -08:00
Stefan Hajnoczi 3fb7991319 staging: line6: drop unused pod atomic_flags field
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:13:50 -08:00
Stefan Hajnoczi 79038f6173 staging: line6: drop pod prog_data buffers
The driver no longer keeps state of MIDI-accessible device parameters.
Drop the buffers but be careful to keep the device startup procedure
working even though we no longer store the contents of the dump request.
The startup procedure will be simplified in a later patch.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:13:50 -08:00
Stefan Hajnoczi 2807904441 staging: line6: drop MIDI parameter sysfs attrs
Both pod.c and variax.c expose the device's MIDI parameters as sysfs
attrs.  Knowledge of MIDI constants should be in userspace, not in the
driver.  Drop the sysfs attrs and let userspace interpret parameters it
cares about instead.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:13:50 -08:00
Stefan Hajnoczi 4528555c8c staging: line6: drop amp/effects dump request triggers
Since the driver no longer needs to keep state of device parameters it
is no longer necessary to refresh state when messages that affect other
parameters are sent.  Drop the code to trigger a dump when amp/effects
are changed.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:13:50 -08:00
Stefan Hajnoczi baa081f127 staging: line6: drop tuner param filtering
The pod_set_system_param_int() helper function is only used to set the
monitor level.  Previously it was also used to control the tuner and has
special checks.  These checks can now be dropped, along with the tuner
constants.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:13:49 -08:00
Stefan Hajnoczi e62025281b staging: line6: drop pod.c raw sysfs attr
The raw sysfs attr transmits MIDI messages with less filtering.  This
was a useful debugging tool while the staging driver still had a lot of
state and filtering.  It is not useful anymore since the filtering is
being dropped.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:13:48 -08:00
Stefan Hajnoczi 370a382fa7 staging: line6: drop midi_postprocess flag
It is no longer necessary to trigger on MIDI transmit messages that will
change the state of the device since:

1. We've dropped the midi_postprocess sysfs attr in a previous commit so
   it is not possible to activate this feature anymore.

2. The other sysfs attrs that could inspect the state after a dump
   request have been dropped.

Therefore we can safely remove this dead code.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:13:48 -08:00
Stefan Hajnoczi bd99f84f48 staging: line6: drop midi_postprocess sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:23 -08:00
Stefan Hajnoczi c7b8ca5a59 staging: line6: drop finish sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:22 -08:00
Stefan Hajnoczi 99c54e9830 staging: line6: drop tuner_pitch sysfs attr
Dropping this final tuner sysfs attr also leaves the
POD_GET_SYSTEM_PARAM() macro, pod_get_system_param_string(), and
pod_get_system_param_int() unused.  Remove them immediately to avoid
compiler warnings.

POD_monitor_level is now the only SYSEX value that needs to be watched
by the driver since the ALSA volume control should reflect the current
monitor volume level used by the device.  Therefore, drop the switch
statement entirely and just check for POD_monitor_level, ignoring
unknown system parameter changes.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:22 -08:00
Stefan Hajnoczi 5e275f4586 staging: line6: drop tuner_mute sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:22 -08:00
Stefan Hajnoczi c9040c8485 staging: line6: drop tuner_note sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:22 -08:00
Stefan Hajnoczi b972739fd8 staging: line6: drop tuner_freq sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:22 -08:00
Stefan Hajnoczi 4cade5c09f staging: line6: drop routing sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:22 -08:00
Stefan Hajnoczi d249652ac4 staging: line6: drop store_effects_setup sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:22 -08:00
Stefan Hajnoczi e6bf11a7a7 staging: line6: drop store_channel sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:16 -08:00
Stefan Hajnoczi 4c41d9210e staging: line6: drop store_amp_setup sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:13 -08:00
Stefan Hajnoczi 7404419c90 staging: line6: drop retrieve_effects_setup sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:13 -08:00
Stefan Hajnoczi 439f21fa22 staging: line6: drop retrieve_channel sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:13 -08:00
Stefan Hajnoczi 390174a935 staging: line6: drop retrieve_amp_setup sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:12 -08:00
Stefan Hajnoczi c62c4df3f9 staging: line6: drop name_buf sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:12 -08:00
Stefan Hajnoczi 3eac723b4b staging: line6: drop name sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:12 -08:00
Stefan Hajnoczi 2c35dc2186 staging: line6: change monitor_level type ValueWait -> int
The monitor_level sysfs attr has been dropped and we never need to wait
on the monitor_level value to change.  Switch to a plain int and drop
the wait queue.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:12 -08:00
Stefan Hajnoczi 410cefa7e9 staging: line6: drop monitor_level sysfs attr
The monitor level can be adjusted using an ALSA volume control.
Therefore the sysfs attribute is unnecessary.  Note that we leave the
monitor_level driver variable so that the ALSA volume control still
works.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:12 -08:00
Stefan Hajnoczi 4fe520dc27 staging: line6: drop dump_buf sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:12 -08:00
Stefan Hajnoczi 980688f9d7 staging: line6: drop dump sysfs attr
Once further sysfs attrs have been removed it will also be possible to
drop prog_data and other pieces which we keep for now.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:12 -08:00
Stefan Hajnoczi b772fe9e33 staging: line6: drop dirty sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:12 -08:00
Stefan Hajnoczi 9c29cf51d1 staging: line6: drop unused param_dirty bitmap
The param_dirty bitmap tracks which parameters have been modified since
saving a preset.  The bitmap is never used though so we can drop this
deadcode.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:11 -08:00
Stefan Hajnoczi cab3c900c1 staging: line6: drop clip sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:11 -08:00
Stefan Hajnoczi 236666e958 staging: line6: drop channel sysfs attr
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:11:11 -08:00
Stefan Hajnoczi e00d33cb5d staging: line6: replace DEBUG_MESSAGES() with dev_dbg()
The dyndbg feature allows dev_dbg() calls to be enabled/disabled at
runtime and is therefore more convenient than static debug log messages.
Use dev_dbg() instead of the line6-specific DEBUG_MESSAGES() macro.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 15:05:03 -08:00
Johannes Thumshirn 06501787d8 staging: line6: Changed strict_strtoul() to kstrtou8() in pod_set_midi_postprocess()
Changed a call to strict_strtoul() into kstrtou8() in
pod_set_midi_postprocess().

Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06 16:12:46 -07:00
Johannes Thumshirn a4fb7d5386 staging: line6: Changed strict_strtoul() to kstrtou8() in pod_set_channel()
Changed strict_strtoul() to kstrtou() in pod_set_channel() to take changes in
pod_send_channel() into account.

Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06 16:12:46 -07:00
Johannes Thumshirn 1d0e834d62 staging: line6: Exchanged strict_strtoul with kstrtou8() in pod.c:pod_resolve()
Exchanged call to strict_strtoul() with kstrtou8() in pod_resolve().

Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06 16:12:46 -07:00
Johannes Thumshirn 8d6b7f7c9b staging: line6: changed interface of pod_send_channel()
Adjusted interface of pod_send_channel() in order to take changes of
line6_send_program() into account.

Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06 16:12:45 -07:00
Johannes Thumshirn 5b9bd2ad51 staging: line6: changed interface of line6_pod_transmit_parameter()
Adjusted interface of line6_pod_transmit_parameter() to take changes of
line6_transmit_parameter() into account

Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06 16:12:45 -07:00
Stefan Hajnoczi 188e664502 staging: line6: eliminate useless NULL checks
The line6 driver checks struct field addresses for NULL where it does
not make sense to do so.  The struct has already been checked for NULL
and there is no value in checking the first field's address too.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Markus Grabner <grabner@icg.tugraz.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:26:09 -08:00
Greg Kroah-Hartman a3a972a053 Staging: line6: fix up my fixup for some sysfs attribute permissions
They should be writable by root, not readable.
Doh, stupid me with the wrong flags.

Reported-by: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Markus Grabner <grabner@icg.tugraz.at>
Cc: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-18 11:27:20 -08:00
Greg Kroah-Hartman 2018845b6a Staging: line6: fix up some sysfs attribute permissions
They should not be writable by any user

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Markus Grabner <grabner@icg.tugraz.at>
Cc: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 11:23:33 -08:00
Greg Kroah-Hartman 027360c564 Staging: line6: minor coding style cleanups
This fixes up all of the remaining coding style issues that
make any sense to make in the line6 driver.

Cc: Markus Grabner <grabner@icg.tugraz.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 16:58:00 -07:00
Markus Grabner e1a164d7a3 Staging: line6: another upstream sync
Everything should be in sync now.

Signed-off-by: Markus Grabner <grabner@icg.tugraz.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 15:28:16 -07:00
Markus Grabner 1027f476f5 staging: line6: sync with upstream
Big upstream sync.

Signed-off-by: Markus Grabner <grabner@icg.tugraz.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 15:28:15 -07:00
Julia Lawall 94002c07ff Staging: Use kmemdup
Use kmemdup when some other buffer is immediately copied into the
allocated region.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
statement S;
@@

-  to = \(kmalloc\|kzalloc\)(size,flag);
+  to = kmemdup(from,size,flag);
   if (to==NULL || ...) S
-  memcpy(to, from, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-17 16:31:15 -07:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Shawn Bohrer 7e4d5c13d8 staging: line6: Convert simple_strtoul to strict_strtoul in pod.c
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:21:47 -08:00
Randy Dunlap 034f585759 Staging: line6: fix printk formats
Fix printk format warnings in line6/pod.c; sizeof() is of type
size_t, so use %zu.

drivers/staging/line6/pod.c:581: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
drivers/staging/line6/pod.c:693: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:21:46 -08:00
Frederik Deweerdt e1769b3cf0 Staging: line6: pod.c: style cleanups
Line6 pod.c: Minor style cleanups

Signed-off-by: Frederik Deweerdt <frederik.deweerdt@xprog.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:34 -07:00
Greg Kroah-Hartman 0fdef36aca Staging: line6: fix checkpatch errors in pod.c
2 errors left, but they are minor.
Lots of warnings also fixed up.

Cc: Markus Grabner <grabner@icg.tugraz.at>
Cc: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:54:26 -07:00
Greg Kroah-Hartman b702ed253d Staging: line6: static function cleanups
This fixes all of the static function warnings that sparse complains
about.

Cc: Markus Grabner <grabner@icg.tugraz.at>
Cc: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:54:25 -07:00