Commit graph

14338 commits

Author SHA1 Message Date
H Hartley Sweeten
98667bf7cc staging: comedi: s626: remove clear of kzalloc'ed data
The private data is kzalloc'ed. There is no need to set any
of the initial data to '0'.

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-09-26 09:37:32 -07:00
H Hartley Sweeten
dc598176bb staging: comedi: s626: remove 'WDInterval' from private data
This variable is never used in the driver. Just remove it.

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-09-26 09:37:32 -07:00
H Hartley Sweeten
7f98961c0d staging: comedi: s626: remove 'ChargeEnabled' from private data
This variable is never used in the driver. Just remove it.

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-09-26 09:37:32 -07:00
H Hartley Sweeten
17553c88a2 staging: comedi: s626: remove 'IsBoardRevA' comment
IsBoardRevA is not defined in the driver. Remove the comment
about it.

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-09-26 09:37:32 -07:00
H Hartley Sweeten
597478473a staging: comedi: s626: #if 0 out the "SAA7146 BUG WORKAROUND"
Until it's determined if this workaround can be removed, block
out the code with an #if 0/#endif and remove the individual
comments on each line.

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-09-26 09:37:32 -07:00
H Hartley Sweeten
68ad0ae0ea staging: comedi: s626: remove 'allocatedBuf' from private data
This variable is only used to count the number of dma buffers
allocated during the attach. If an allocation fails, the attach
function exits with -ENOMEM. When this variable is checked later
it will always be == 2. Just remove the variable and the check.

This allows bringing the code back an indent level in
s626_initialize(). Note, coding style issues in this function
are not addressed yet.

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-09-26 09:37:31 -07:00
H Hartley Sweeten
f996ab29e9 staging: comedi: s626: add final attach message
Add a simple dev_info() message after a successfull attach.
Change the final return to '0' to indicate success.

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-09-26 09:37:31 -07:00
H Hartley Sweeten
b7eaf21a67 staging: comedi: s626: remove unneeded clear of private data
The private data is kzalloc'ed. All the variables in it are
initially '0'.

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-09-26 09:37:31 -07:00
H Hartley Sweeten
80ec951029 staging: comedi: s626: factor out the board init code
To make the attach a bit cleaner, factor the board init code
out of attach_pci() into a new function.

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-09-26 09:37:31 -07:00
H Hartley Sweeten
8c7e4277c1 staging: comedi: s626: cleanup request_irq in s626_attach_pci()
Only set dev->irq if request_irq is successfull.

Remove the kernel message noise.

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-09-26 09:37:31 -07:00
H Hartley Sweeten
b7047895b9 staging: comedi: s626: factor out the dma buffer allocation
To make the attach a bit cleaner, factor the dma buffer allocation
out of attach_pci() into a new function.

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-09-26 09:37:31 -07:00
H Hartley Sweeten
97d87e00e3 staging: comedi: s626: remove unnecessary checks of 'devpriv->base_addr'
'devpriv->base_addr' is valid from this point on in the attach_pci()
function. Remove the unnecessary checks.

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-09-26 09:37:30 -07:00
H Hartley Sweeten
4f6c7bf992 staging: comedi: s626: cleanup ioremap()
The local variable 'resourceStart' is only used in the ioremap()
to hold the PCI bar 0 base address. Just use the pci_resource_start()
directly in the ioremap().

Also, instead of assuming the resource size for the ioremap, use
pci_resource_len() to get the actual size.

Remove the kernel noise when the ioremap fails and change the error
code from -ENODEV to -ENOMEM.

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-09-26 09:37:30 -07:00
H Hartley Sweeten
58f4a8fce1 staging: comedi: s626: remove 'got_regions' from private data
This variable is only used as a flag to indicate that the pci device
has been enabled and needs to be disabled in the detach. Use the
comedi_device 'iobase' for this and remove the private data 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>
2012-09-26 09:37:30 -07:00
H Hartley Sweeten
41f821d077 staging: comedi: s626: remove unneeded local variable in attach_pci()
The 'result' variable is only used to check the return from
comedi_pci_enable(). Just reuse the 'ret' variable.

Also, remove the kernel noise and use the error code from
comedi_pci_enable() instead of returning -ENODEV.

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-09-26 09:37:30 -07:00
H Hartley Sweeten
7c843aa773 staging: comedi: s626: use dev->board_name for resource name
Instead of the literal string "s626", use the dev->board_name for
the resource name when enabling the PCI device and requesting the
irq.

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-09-26 09:37:30 -07:00
H Hartley Sweeten
f574af6d26 staging: comedi: s626: store the pci_dev in the comedi_device
Use the hw_dev pointer in the comedi_device struct to hold the
pci_dev instead of carrying it in the private data.

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-09-26 09:37:30 -07:00
H Hartley Sweeten
91e674e83c staging: comedi: s626: use attach_pci callback
Convert this PCI driver to use the comedi PCI auto config attach
mechanism by adding an 'attach_pci' callback function. Since the
driver does not require any external configuration options, and
the legacy 'attach' callback is not optional, remove it.

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-09-26 09:37:29 -07:00
H Hartley Sweeten
832defbb58 staging: comedi: s626: remove boardinfo
This driver only supports one board type. Move the used board info
out of the boardinfo struct and remove it.

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-09-26 09:37:29 -07:00
Ian Abbott
198b0fa48b staging: comedi: ni_daq_700: add AI subdevice
Add subdevice 1 as an analog input (AI) subdevice.  It currently only
supports basic, software-triggered acquisitions.

This is mostly the work of Fred Brooks (MODULE_AUTHOR), but he based his
update on an older version of the driver.  I applied the relevant
changes with a few tweaks: adding an explicit `udelay(1)` in a timeout
loop, replacing binary constants with hex, renaming functions, replacing
`printk()` calls, removing exported symbols, removing (very) incomplete
comedi "command" support, and making some coding-style changes.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:35:51 -07:00
Ian Abbott
08351926d2 staging: comedi: ni_daq_700: rename functions for DIO subdevice
Rename `subdev_700_insn()` to `daq700_dio_insn_bits()` and
`subdev_700_insn_config()` to `daq700_dio_insn_config()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:35:50 -07:00
Ian Abbott
9d54814f31 staging: comedi: ni_daq_700: use prefix daq700
Rename a few functions and variables to use the prefix `daq700` instead
of the prefix or suffix `dio700`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:35:50 -07:00
Kevin McKinney
4b0cb3cb3b Staging: bcm: Remove typedef for _stCPacketClassificationRuleSI and call directly.
This patch removes typedef for
_stCPacketClassificationRuleSI, changes the
name of the struct to bcm_packet_class_rules,
and updates the comments appropriately . In
addition, any calls to typedefs
"CCPacketClassificationRuleSI,
stCPacketClassificationRuleSI,
or *pstCPacketClassificationRuleSI" are changed
to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:31:52 -07:00
Kevin McKinney
d2a392c2bd Staging: bcm: Remove typedef for _stPhsRuleSI and call directly.
This patch removes typedef for _stPhsRuleSI,
changes the name of the struct to
bcm_phs_rules, and updates the comments
appropriately. In addition, any
calls to typedefs "stPhsRuleSI,
*pstPhsRuleSI, or CPhsRuleSI" are
changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:31:52 -07:00
Kevin McKinney
c07b53131e Staging: bcm: Remove typedef for _stConvergenceSLTypes and call directly.
This patch removes typedef for _stConvergenceSLTypes,
changes the name of the struct to
bcm_convergence_types, and updates the
comments appropriately. In addition, any
calls to typedefs "stConvergenceSLTypes,
CConvergenceSLTypes, and *pstConvergenceSLTypes"
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:31:52 -07:00
Kevin McKinney
b766fb15e1 Staging: bcm: Remove typedef for _stServiceFlowParamSI and call directly.
This patch removes typedef for _stServiceFlowParamSI,
changes the name of the struct to
bcm_connect_mgr_params, and updates the
comments appropriately. In addition, any
calls to typedefs "stServiceFlowParamSI,
*pstServiceFlowParamSI, and CServiceFlowParamSI"
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:31:52 -07:00
Kevin McKinney
fc1ad16277 Staging: bcm: Remove typedef for _stLocalSFAddRequest and call directly.
This patch removes typedef for _stLocalSFAddRequest,
and changes the name of the struct to
bcm_add_request. In addition, any
calls to typedefs "stLocalSFAddRequest or
*pstLocalSFAddRequest" are changed to
call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:31:52 -07:00
Kevin McKinney
da529f0ffb Staging: bcm: Remove typedef for _stLocalSFAddIndication and call directly.
This patch removes typedef for _stLocalSFAddIndication,
and changes the name of the struct to
bcm_add_indication. In addition, any
calls to typedefs "stLocalSFAddIndication,
*pstLocalSFAddIndication, stLocalSFChangeRequest,
*pstLocalSFChangeRequest, stLocalSFChangeIndication,
or *pstLocalSFChangeIndication " are changed to
call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:31:52 -07:00
Kevin McKinney
ec5bb99264 Staging: bcm: Remove typedef for _stLocalSFDeleteRequest and call directly.
This patch removes typedef for _stLocalSFDeleteRequest,
and changes the name of the struct to
bcm_del_request. In addition, any
calls to typedefs "stLocalSFDeleteRequest or
*pstLocalSFDeleteRequest" are
changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:31:51 -07:00
Kevin McKinney
de473db168 Staging: bcm: Remove typedef for stLocalSFDeleteIndication and call directly.
This patch removes typedef for
stLocalSFDeleteIndication, and
changes the name of the struct to
bcm_del_indication. In addition, any
calls to the following typedef
"stLocalSFDeleteIndication" are changed to call
the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:31:51 -07:00
Devendra Naga
53176607a4 staging: rtl8712: fix foo* bar (foo*) errors reported by checkpatch
fixes the following errors:

drivers/staging/rtl8712/rtl871x_security.c:61: ERROR: "foo * bar" should
be "foo *bar"
drivers/staging/rtl8712/rtl871x_security.c:291: ERROR: "foo * bar"
should be "foo *bar"
drivers/staging/rtl8712/rtl871x_security.c:323: ERROR: "foo * bar"
should be "foo *bar"
drivers/staging/rtl8712/rtl871x_security.c:1371: ERROR: "(foo*)" should
be "(foo *)"

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:23:31 -07:00
Devendra Naga
c06df2334c staging: rtl8712: fix a foo * bar errors reported by checkpatch
fixes the following error:

drivers/staging/rtl8712/rtl8712_xmit.c:379:  ERROR: "foo * bar" should
be "foo *bar"

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:23:31 -07:00
Devendra Naga
e1656648c9 staging: rtl8712: remove assignment of 0 to a static global variable
fixes the following checkpatch warning:

drivers/staging/rtl8712/os_intfs.c:99: ERROR: do not initialise statics
to 0 or NULL

as statics are always initialised to 0.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:23:31 -07:00
Dan Carpenter
55e7b4fbd4 staging: rts5139: use kzalloc() to close an info leak
If we don't fill the whole buffer then there is information leaked to
the user.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:19:50 -07:00
Justin P. Mattock
d34602de3b staging "wlan-ng" Fix typos.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:19:50 -07:00
Harsh Kumar
bd084bac93 Staging: winbond: Removed undesired spaces, lines and tabs
checkpatch cleanup: Removed some undesired spaces, lines and tabs to comply with coding style.

Signed-off-by: Harsh Kumar <harsh1kumar@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:18:46 -07:00
Harsh Kumar
37594bb99f Staging: winbond: Changed c99 comments to c89 comments
checkpatch cleanup: Changed c99 comments to c89 comments

Signed-off-by: Harsh Kumar <harsh1kumar@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:18:45 -07:00
Greg Kroah-Hartman
71c6290246 Fifth round of new drivers and device support for the IIO
subsystem in the 3.7 cycle.
 
 Here we have a mixed bag of new stuff, minor fixes and
 more major fixes for drivers added earlier in this cycle.
 
 1) A number of fixes for the HID sensors code added in previous
 pull request.  Typical stuff that has become apparent as more eyes
 have looked at the code post merging. Similar case for the ad5755 dac.
 
 2) Cleanups of error handing in inkern.c - again typical stuff to see
 as code comes into heavier use and people notice the naughty short
 cuts that snuck in originally and kindly fix them.
 
 3) A series from Lars that removes some incorrect error handling
 from the remove functions of a number of drivers.  These have been
 there for a very long time hence I'm not pushing these out for the
 3.6 cycle.
 
 4) Support for more parts in the ad7780 driver.
 
 5) A driver for the adcs on the lp8788 power management unit
 
 6) A client driver for IIO to allow it's ADCs to be used for
 battery status measurement.  Note this driver has some dependencies
 on some utility functions added to IIO in this series, hence it is
 coming via this tree rather than Anton's.
 
 7) A null pointer dereference bug in the 'fake' driver. I'm not
 doing this as a fix for the 3.6 cycle because it only effects
 'fake' hardware and that code is typically only used by people
 investigating how IIO works as part of writing new drivers. Hence
 it's hardly a critical fix.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJQXY5xAAoJEFSFNJnE9BaIRb8QALEFNnwSu9AzF2rvDMiHExWB
 ndIwbOOdQchI7CigOtyyJ1W61XHp3jnPoPNrz4+qjszFldXMKxmnYZDZGMEdzKTn
 ygwTiD64Q2aOHqMFpC5GSCn+y2eFgxMrIo8bzokGKCqEwKRhgR/VvvMTVZutkCeD
 YZuVnAA8sQ6Oo9L41XJtPV9xUwTLyAJAZgA84ePWJN39zxUw9YrX+wAs2ZoRjkG0
 LKMUpDOgaIQ+3ZDWwlOjWpfVA6VaQpabZy5wqdT1dTptoiUg+CTVxlfiPeZyKoTL
 FLEetFVFIYI9sJLuyjWK5122t5+AOfhuWqL3T537VzdAudRJ67lvwt/w4/yDW4sB
 mJfcx46gwUyhDxZ2nrSt3DsTJTIkiSznUIY6eyLMTc5WtCzX9JCjVYYSQvKpffnk
 Ul5tzsT6QMKkAZNudDMC3bWn1LarYsuA2Yqecb4s+ywEKKgw8eeTS/IRKs8/Kr02
 oIXyWPxHCypcX6WCG4UrSTYZczOMIZQyeaADjCGv0lXnA0aX4TrK6E7adRjfQLAk
 Ed8al4kW2YkmX4K17SLh81farpyO+/jJO3PuEJ70a0Cu2/6tqHtZji4VD7SJc6tf
 +WNTIoN2vCq1KjL0iffeTbh/JxXn7z9ET1RowM8qJRK02QL3KikFceTXv/3Rq9K4
 8P150ZKGW84AS8S0BdQQ
 =HADL
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-v3.7e' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Fifth round of new drivers and device support for the IIO
subsystem in the 3.7 cycle.

Here we have a mixed bag of new stuff, minor fixes and
more major fixes for drivers added earlier in this cycle.

1) A number of fixes for the HID sensors code added in previous
pull request.  Typical stuff that has become apparent as more eyes
have looked at the code post merging. Similar case for the ad5755 dac.

2) Cleanups of error handing in inkern.c - again typical stuff to see
as code comes into heavier use and people notice the naughty short
cuts that snuck in originally and kindly fix them.

3) A series from Lars that removes some incorrect error handling
from the remove functions of a number of drivers.  These have been
there for a very long time hence I'm not pushing these out for the
3.6 cycle.

4) Support for more parts in the ad7780 driver.

5) A driver for the adcs on the lp8788 power management unit

6) A client driver for IIO to allow it's ADCs to be used for
battery status measurement.  Note this driver has some dependencies
on some utility functions added to IIO in this series, hence it is
coming via this tree rather than Anton's.

7) A null pointer dereference bug in the 'fake' driver. I'm not
doing this as a fix for the 3.6 cycle because it only effects
'fake' hardware and that code is typically only used by people
investigating how IIO works as part of writing new drivers. Hence
it's hardly a critical fix.
2012-09-25 15:52:56 -07:00
Harsh Kumar
9970eeae48 staging: winbond: Coding Style correction and removal of unused macro
Removed an unused macro. Plus, couple of grammatical and coding style fixes.

1) The macro _INLINE is not used anywhere. Anyways __inline is not portable.
2) Changed comment from "Not use" to "Unused" make it grammatically correct and
   to fit in 80 word limit.
3.) Removed space after *

Signed-off-by: Harsh Kumar <harsh1kumar@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-25 15:48:26 -07:00
Alexey Khoroshilov
4c229df0b1 staging: sbe-2t3e3: fix error handling in t3e3_init_channel()
t3e3_init_channel() incorrectly handles errors in several places:
it returns zero and does not deallocate all required resources.
The patch fixes that places.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-25 15:48:25 -07:00
Lars-Peter Clausen
3fff227436 staging:iio:dummy: Fix potential NULL pointer dereference
If the config contains CONFIG_IIO_BUFFER=y and CONFIG_IIO_SIMPLE_DUMMY_BUFFER=n
iio_simple_dummy_configure_buffer() is stubbed out and iio_buffer_register() is
not. As a result we try to register a buffer which has not been configured.
This will causes a NULL pointer deref in iio_buffer_register. To solve this
issue move the iio_buffer_register() call to iio_simple_dummy_configure_buffer(),
so it will only be called if iio_simple_dummy_configure_buffer() has been called.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22 10:55:08 +01:00
Lars-Peter Clausen
7aecec986e staging:iio:ad7780: Add support for the ad7170/ad7171
The ad7170/ad7171 have a software interface similar to the ad7780. They do not
have an external pin which allows to change the internal gain and the what is
used for the gain bit in the ad7780/ad7781 becomes part of the check pattern.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22 10:25:32 +01:00
Lars-Peter Clausen
332ed63ee9 staging:iio:ad7780: Make powerdown GPIO optional
Some designs hardwire the PDRST pin to always on. In this case there is no GPIO
to control the mode of the device, so make the GPIO optional. Since now all of
the the platform data fields are optional now, make the platform data as a whole
optional as well.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22 10:24:20 +01:00
Lars-Peter Clausen
67ad4e08dc staging:iio:sca3000: Do not return a error in remove function
In the Linux device driver model the remove callback is not allowed to fail and
the device will be removed regardless of the return value of the remove
callback. So if we abort in the remove function and do not free all resources we
will create a resource leak. Also all kinds of undefined behaviour are expected
to happen since the IIO device is still there while its parent is already gone.

The errors which the driver tries to handle in the remove function are
non-critical, so we can just ignore them and continue to free all resources and
remove the IIO device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22 10:20:30 +01:00
Lars-Peter Clausen
e71a837c81 staging:iio:lis3l02dq: Do not return a error in remove function
In the Linux device driver model the remove callback is not allowed to fail and
the device will be removed regardless of the return value of the remove
callback. So if we abort in the remove function and do not free all resources we
will create a resource leak. Also all kinds of undefined behaviour are expected
to happen since the IIO device is still there while its parent is already gone.

The errors which the driver tries to handle in the remove function are
non-critical, so we can just ignore them and continue to free all resources and
remove the IIO device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22 10:20:11 +01:00
Lars-Peter Clausen
e854bcc938 staging:iio:ade7759: Do not return a error in remove function
In the Linux device driver model the remove callback is not allowed to fail and
the device will be removed regardless of the return value of the remove
callback. So if we abort in the remove function and do not free all resources we
will create a resource leak. Also all kinds of undefined behaviour are expected
to happen since the IIO device is still there while its parent is already gone.

The error which the driver tries to handle in the remove function is
non-critical, so we can just ignore it and continue to free all resources and
remove the IIO device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22 10:19:57 +01:00
Lars-Peter Clausen
4922fd697a staging:iio:ade7758: Do not return a error in remove function
In the Linux device driver model the remove callback is not allowed to fail and
the device will be removed regardless of the return value of the remove
callback. So if we abort in the remove function and do not free all resources we
will create a resource leak. Also all kinds of undefined behaviour are expected
to happen since the IIO device is still there while its parent is already gone.

The error which the driver tries to handle in the remove function is
non-critical, so we can just ignore it and continue to free all resources and
remove the IIO device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22 10:18:42 +01:00
Lars-Peter Clausen
db314a1aaa staging:iio:ade7754: Do not return a error in remove function
In the Linux device driver model the remove callback is not allowed to fail and
the device will be removed regardless of the return value of the remove
callback. So if we abort in the remove function and do not free all resources we
will create a resource leak. Also all kinds of undefined behaviour are expected
to happen since the IIO device is still there while its parent is already gone.

The error which the driver tries to handle in the remove function is
non-critical, so we can just ignore it and continue to free all resources and
remove the IIO device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22 10:18:25 +01:00
Lars-Peter Clausen
d576c75586 staging:iio:ade7753: Do not return a error in remove function
In the Linux device driver model the remove callback is not allowed to fail and
the device will be removed regardless of the return value of the remove
callback. So if we abort in the remove function and do not free all resources we
will create a resource leak. Also all kinds of undefined behaviour are expected
to happen since the IIO device is still there while its parent is already gone.

The error which the driver tries to handle in the remove function is
non-critical, so we can just ignore it and continue to free all resources and
remove the IIO device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22 10:18:10 +01:00
Lars-Peter Clausen
0b4ac3dce4 staging:iio:adis16400: Do not return a error in remove function
In the Linux device driver model the remove callback is not allowed to fail and
the device will be removed regardless of the return value of the remove
callback. So if we abort in the remove function and do not free all resources we
will create a resource leak. Also all kinds of undefined behaviour are expected
to happen since the IIO device is still there while its parent is already gone.

The error which the driver tries to handle in the remove function is
non-critical, so we can just ignore it and continue to free all resources and
remove the IIO device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22 10:17:28 +01:00