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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>