Devendra Naga [Thu, 25 Oct 2012 06:11:51 +0000 (02:11 -0400)]
staging: slicoss: fix a leak when kzalloc fail
slic_card_locate does a kzalloc of physcard, and if it fails,
in my previous patch i returned -ENOMEM, but left the driver leak
the memory if card_hostid == SLIC_HOSTID_DEFAULT,
fix this memory leak if the above condition is true
Dan Carpenter [Thu, 25 Oct 2012 12:30:06 +0000 (15:30 +0300)]
staging: r8712u: cleanup pointer type in r8712_setassocsta_cmd()
This seems like a cut and paste bug. Smatch complains that we don't
allocate enough memory for a set_stakey_rsp struct. In fact this is
used as a set_assocsta_rsp struct throughout and that also matches the
name of the function.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix the use of insn->chanspec with the CR_CHAN, CR_RANGE, and CR_AREF
macros. insn->chanspec is an unsigned int not an array.
Cleanup the comments when creating the 'val' to write to the channel
list fifo so that the code is a bit more readable.
Use the 'val' variable when getting the value from the ADC fifo and
then munging the data. This cleans up the goofy line breaks.
This function still does not follow the expectations of the comedi core.
It is supposed to read insn->n values from the channel and return those
values. Currently it only reads a single value.
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>
This function only needs to update the output channel state when
the 'mask' (data[0]) indicates that the state is changing. It's
also supposed to return the state for all the input and output
channels in data[1].
This function appears to work correctly but it's coded quite
differently form the other comedi drivers. Rework the function so
it follows the normal form. Also, use a couple local variables
for the mmio addresses used to read/write the dio ports.
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>
staging: comedi: me_daq: simplify analog output boardinfo
The boards supported by this driver either have analog outputs or don't
have them. Add a new boardinfo value, 'has_ao', to indicate this.
The boards that have analog outputs always have 4, 12-bit channels. Remove
the unnecessary boardinfo and just open-code the values in the subdevice
initialization.
The boards with analog outputs also share the same output range capabilities.
Rename the comedi_lrange to make it common for all board types.
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>
staging: comedi: me_daq: all boards have the same analog input specs
All the boards supported by this driver have the same analog input
specifications. Remove the unnecessary boardinfo and just open-code
the values in the subdevice initialization.
The boards also share the same analog input range capabilities. Remove
one of the duplicate tables and rename the other to make it common for
all board types.
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>
staging: comedi: me_daq: cleanup the copyright and comedi comments
Reformat the copyright and driver description comments to follow the
preferred block comment style. Reword the driver description to follow
comedi style described 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>
This function is supposed to write to a single analog output channel.
The channel number is packed in insn->chanspec, which is an unsigned
int, and unpacked using the CR_CHAN() macro.
Currently this function is trying to use the chanspec as an array.
This works only if a single value is written.
Fix the function so that the desired channel is determined and all
the data is written to that channel.
Also, fix the return. The comedi core expects insn_read functions to
return the number of data values (insn->n).
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>
This function is supposed to return the analog output value for
a specified channel. The channel number is packed in insn->chanspec,
which is an unsigned int, and unpacked using the CR_CHAN() macro.
Currently this function is trying to use the chanspec as an array.
This works only if a single data value is read.
Fix the function so that the desired channel is determined and all
the data returned is from that channel.
Also, fix the return. The comedi core expects insn_read functions to
return the number of data values (insn->n).
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>
staging: comedi: me_daq: remove pci_dev_put() in detach
This driver uses the comedi auto config mechanism and does not
walk the pci bus to find the pci_dev. It should not be calling
pci_dev_put() to decrement the ref count.
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>
staging: comedi: me_daq: factor out the PLX bug workaround
Factor out the code in me_attach_pci() that handles the PLX-Bug
workaround to a separate function.
This looks odd. It appears that the bug workaround either swaps
PCI bars 0 and 5 or it modifies PCI bar 0. Shouldn't this happen
before PCI bar 0 is ioremap'ed?
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>
staging: comedi: me_daq: replace 'result' and 'error' with 'ret'
Two local variables are used in me_attach_pci() to check for errors
when calling other functions, 'result' and 'error'. Remove both of
them and just use a common 'ret' variable.
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>
staging: comedi: me_daq: cleanup ioremap of PCI bar 2
PCI bar 2 is the main i/o address for this driver. Currently the
pci_resource_len of the bar is stored in the private data but
it is never used.
Remove 'me_regbase_size' from the private data. Also, remove the
local variables used for the pci_resource_start and _len. Just
pass the values directly to the ioremap().
Remove the kernel noise when the ioremap fails.
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>
staging: comedi: me_daq: fix pointer dereference in me_detach()
As pointed out by Dan Carpenter, dev_private could be NULL when it
is checked before calling comedi_pci_disable(). The private data
variable 'plx_regbase_size' is only used to see if the pci device
has been enabled.
Remove that variable from the private data and just use the unused
dev->iobase variable to let the detach know that the pci device
is enabled.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: dt3000: change return type of dt3k_send_cmd to void
None of the callers check the return value. Just make it a void.
Flip the status check at the end of the function to check for an
error before outputing the dev_dbg(). Use __func__ for the function
name in the message.
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>
Devendra Naga [Thu, 25 Oct 2012 05:50:58 +0000 (01:50 -0400)]
staging: csr: remove panic at locking the mutex
when down_interruptible fail, means a signal occur, or any other failure
we are panicing, and it seems that we should not panic, instead we would
have done a spinlock, but currently removing the panic call.
Fabio Estevam [Wed, 24 Oct 2012 23:36:46 +0000 (21:36 -0200)]
staging: ipu-v3: ipu-common: Make it less verbose
IPU Interrupt numbers and the various IPU submodules base addresses are
more interesting for debugging purposes rather than normal use, so use
dev_dbg instead.
Kees Cook [Tue, 23 Oct 2012 20:02:06 +0000 (13:02 -0700)]
drivers/iio/dac: remove CONFIG_EXPERIMENTAL
This config item has not carried much meaning for a while now and is
almost always enabled by default. As agreed during the Linux kernel
summit, remove it.
CC: Jonathan Cameron <jic23@cam.ac.uk> CC: Lars-Peter Clausen <lars@metafoo.de> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> CC: Michael Hennerich <michael.hennerich@analog.com> CC: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The PCI chip used on this board is from PLX Technologies Inc. As stated
in the comments of this driver, Dynalog does not have a registered PCI
vendor id so this board uses the PLX vendor id. The kernel provides an
id for that vendor in pci_ids.h (PCI_VENDOR_ID_PLX). Use it instead of
creating a duplicate with a different name.
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>
Rename the define used for the D/A Data register so that is has
namespace with this driver. Change the define so that it takes
the channel as a parameter to calculate the correct register
offset.
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>
staging: comedi: cb_pcidda: cleanup the copyright and comedi comments
Reformat the copyright and driver description comments to follow the
preferred block comment style. Reword the driver description to follow
comedi style described 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>
staging: comedi: cb_pcidda: cleanup the analog output range
All the boards supported by this driver have the same analog output
ranges. Remove the 'range' from the boardinfo and just use the
'cb_pcidda_ranges' directly when initializing the subdevice.
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>
staging: comedi: cb_pcidda: check for subdev_8255_init() failure
The subdev_8255_init() can fail, make sure to check for it.
This board has two 8255 subdevices, one at iobase PCI bar2 and one
at iobase PCI bar2 + 4. Init the subdevices using a for() loop to
make the code a bit more concise.
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>
staging: comedi: cb_pcidda: remove private data variable 'digitalio'
The private data variable 'digitalio' is only used to hold the PCI
base address for the 8255 devices on the board. This value is then
passed to subdev_8255_init() and stored in it's own private data.
There is no need to keep the value in the private data for the board.
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>
staging: comedi: cb_pcidda: remove code in #if 0/#endif blocks
The functions cb_pcidda_ai_cmd(), cb_pcidda_ai_cmdtest(), and
cb_pcidda_ns_to_timer() are all partially coded stubs for command
support with the analog output subdevice. Just remove the code
since it is #if 0'ed out. It can be added back later if command
support is completed.
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>
Update the prompt line and description for the COMEDI_AMPLC_DIO200_PCI
config option to add the new PCIe boards supported by the "amplc_dio200"
driver.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 24 Oct 2012 15:48:13 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: support multiple read/write of counter
Change the `insn_read` and `insn_write` handlers of the '8254' counter
subdevices to support reading and writing multiple data values.
(Writing multiple values isn't very useful, but if that's what the user
wants....)
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 24 Oct 2012 15:48:08 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: allow extra clock and gate sources
One of the enhancements of the new PCIe boards is the addition of extra
clock and gate sources. Allow clock and gate sources up to 31 for these
boards (compared to 7 for the old boards) although most of those are
reserved for future use.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 24 Oct 2012 15:48:07 +0000 (16:48 +0100)]
staging: comedi: amplc_dio200: enable enhanced features of PCIe boards
The new PCIe boards PCIe215, PCIe236 and PCIe296 have some enhanced
features (over the older boards), although none of these features are
supported by this driver yet.
Enable the enhanced features in hardware and use `dio200_layouts[]` to
indicate which boards support the enhanced features.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>