dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

312286 Commits

Author SHA1 Message Date
H Hartley Sweeten ad196be73d staging: comedi: daqboard2000: 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-07-19 16:32:57 -07:00
H Hartley Sweeten f55354b0a8 staging: comedi: daqboard2000: remove 'got_regions' from private data
The 'got_regions' variable in the private data is used as a flag
for the detach to know if the pci device has been enabled.

Typically the dev->iobase variable is used to indicate this in
all the other comedi drivers. Do the same here for consistancy.

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-07-19 16:32:57 -07:00
H Hartley Sweeten f34ec8002b staging: comedi: daqboard2000: cleanup "find pci device" code
The "find pci device" code for this driver was quite a bit
different from the other comedi pci drivers. Clean it up so
it follows the format of the other drivers.

Use for_each_pci_dev() instead of open-coding the loop using
pci_get_device().

Check for a specific bus/slot then the vendor/device ids.

The loop checking for the matching boardinfo was creating an
"id" based on the subsystem_device and subsystem_vendor info
from the pci_dev. The vendor id was already checked so just
check against the subsystem_device.

Only return the pci_dev if a matching boardinfo is found.

Consolidate the dev_err messages when a device is not found
into a single 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>
2012-07-19 16:32:57 -07:00
H Hartley Sweeten 6896ddfa10 staging: comedi: daqboard2000: factor out the "find pci device" code
Factor the "find pci device" code out of the attach 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-07-19 16:32:57 -07:00
H Hartley Sweeten 49cd97b9be staging: comedi: contec_pci_dio: remove the private data
The private data is no longer needed by this driver. Remove the
struct, devpriv macro, and the allocation.

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-07-19 16:32:57 -07:00
H Hartley Sweeten e3ab476bee staging: comedi: contec_pci_dio: 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-07-19 16:32:57 -07:00
H Hartley Sweeten b8acd7750a staging: comedi: contec_pci_dio: cleanup "find pci device" code
Add a couple local variables and reorder the tests to make
to make the more concise.

Change the printk to a dev_err when no match is found and reword
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>
2012-07-19 16:32:56 -07:00
H Hartley Sweeten f0bd6d3575 staging: comedi: contec_pci_dio: factor out the "find pci device" code
Factor the "find pci device" code out of the attach 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-07-19 16:32:56 -07:00
H Hartley Sweeten 16dd84f52c staging: comedi: cb_pcimdas: 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-07-19 16:32:56 -07:00
H Hartley Sweeten 6d2d7ef731 staging: comedi: cb_pcimdas: remove BADR0 from the private data
The pci resource bar 0 address is only used as a "flag" to
let the datach function know that the pci device has been
enabled. Use dev->iobase in the detach instead and remove
BADR0 from 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-07-19 16:32:56 -07:00
H Hartley Sweeten 6191a3ff59 staging: comedi: cb_pcimdas: remove BADR2 from the private data
The pci resource bar 2 address is the primary i/o address used
by this device. Store it in dev->iobase and remove it from 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-07-19 16:32:56 -07:00
H Hartley Sweeten 8e2f2384c7 staging: comedi: cb_pcimdas: remove BADR4 from the private data
The pci resource bar 4 address is only needed to initialize the
8255 subdevice. Use a local variable to hold it and remove it
from 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-07-19 16:32:56 -07:00
H Hartley Sweeten 170581bf48 staging: comedi: cb_pcimdas: remove BADR1 from the private data
The pci resource bar 1 address is not used in the driver. Remove
it from 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-07-19 16:32:56 -07:00
H Hartley Sweeten 2852230eb2 staging: comedi: cb_pcimdas: cleanup the private data
Remove the unused variables from 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-07-19 16:32:55 -07:00
H Hartley Sweeten 718c39e8ff staging: comedi: cb_pcimdas: remove the debug print of the pci bars
Remove the dev_dbg output of the pci addresses. It's just add 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-07-19 16:32:55 -07:00
H Hartley Sweeten 366d6245fb staging: comedi: cb_pcimdas: cleanup "find pci device" code
Add a couple local variables to make the tests more concise.

Reorder the tests to make the for() loop checking for a
matching boardtype quicker.

Use ARRAY_SIZE() to determine the number of boards instead
of the hard-coded '1'.

Drop the dev_dbg for a match. It's just add noise.

Reword the dev_err when no match is found.

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-07-19 16:32:55 -07:00
H Hartley Sweeten 46a4ff0dbc staging: comedi: cb_pcimdas: factor out the "find pci device" code
Factor the "find pci device" code out of the attach 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-07-19 16:32:55 -07:00
H Hartley Sweeten cdb82250ea staging: comedi: cb_pcidio: remove the private data
The private data is no longer needed by this driver. Remove the
struct, devpriv macro, and the allocation.

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-07-19 16:32:55 -07:00
H Hartley Sweeten dbd658fc0c staging: comedi: cb_pcidio: store the iobase in the comedi_device
Save the pci bar in dev->iobase 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-07-19 16:32:55 -07:00
H Hartley Sweeten 04cec90cd3 staging: comedi: cb_pcidda: 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.

Save the pci bar in dev->iobase so the detach is consistent with
the other comedi pci drivers.

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-07-19 16:32:54 -07:00
H Hartley Sweeten 5b7c52a78d staging: comedi: cb_pcidda: cleanup "find pci device" code
Add a couple local variables to make the tests more concise.
Reorder the tests to make the for() loop checking for a
matching boardtype quicker.

Drop the dev_dbg for a match. It's just add noise.
Reword the dev_err when no match is found.

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-07-19 16:32:54 -07:00
H Hartley Sweeten 84b2d57c0b staging: comedi: cb_pcidda: factor out the "find pci device" code
Factor the "find pci device" code out of the attach 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-07-19 16:32:54 -07:00
H Hartley Sweeten 000e263502 staging: comedi: cb_pcidas64: 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.

Save the pci bar in dev->iobase so the detach is consistent with
the other comedi pci drivers.

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-07-19 16:32:54 -07:00
H Hartley Sweeten 8826270341 staging: comedi: cb_pcidas64: cleanup "find pci device" code
Add a couple local variables to make the tests more concise.
Reorder the tests to make the for() loop checking for a
matching boardtype quicker.

Drop the dev_dbg for a match. It's just add noise.
Reword the dev_err when no match is found.

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-07-19 16:32:54 -07:00
H Hartley Sweeten eeff9dbc6f staging: comedi: cb_pcidas64: factor out the "find pci device" code
Factor the "find pci device" code out of the attach 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-07-19 16:32:54 -07:00
H Hartley Sweeten c5866e7850 staging: comedi: amplc_pci230: 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-07-19 16:32:54 -07:00
H Hartley Sweeten 2605d35b43 staging: comedi: amplc_pci230: cleanup "find pci device" code
For aesthetic reasons, rename the function and pass the
comedi_devconfig struct instead of pre-parsing out the bus/slot
information.

Consolidate the dev_err messages when a pci device is not found.

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-07-19 16:32:53 -07:00
H Hartley Sweeten 415417040f staging: comedi: amplc_pci224: 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-07-19 16:32:53 -07:00
H Hartley Sweeten 89ed0731bc staging: comedi: amplc_pci224: cleanup "find pci device" code
For aesthetic reasons, rename the function and pass the
comedi_devconfig struct instead of pre-parsing out the bus/slot
information.

Use for_each_pci_dev() instead of open-coding the loop using
pci_get_device().

Consolidate the dev_err messages when a pci device is not found.

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-07-19 16:32:53 -07:00
H Hartley Sweeten 69fa3b755e staging: comedi: amplc_pc263: 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.

Since the pci_dev is no longer held in the provate data, we can
also cleanup the detach a bit. Remove the IS_ENABLED() tests in
the detach. If the pci_dev is non NULL it's a PCI device otherwise
it's an ISA device. Using IS_ENABLED() to omit the code paths
makes the code a bit confusing and doesn't save much.

Since the pci_dev was the only thing in the private data, remove
the struct, and it's allocation.

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-07-19 16:32:53 -07:00
H Hartley Sweeten 1c16519fc2 staging: comedi: amplc_pc263: cleanup "find pci device" code
For aesthetic reasons, rename the function and pass the
comedi_devconfig struct instead of pre-parsing out the bus/slot
information.

Use for_each_pci_dev() instead of open-coding the loop using
pci_get_device().

Consolidate the dev_err messages when a pci device is not found.

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-07-19 16:32:53 -07:00
H Hartley Sweeten b6d446b5de staging: comedi: amplc_pc236: 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.

Since the pci_dev is no longer held in the provate data, we can
also cleanup the detach a bit. Remove the IS_ENABLED() tests in
the detach. If the pci_dev is non NULL it's a PCI device otherwise
it's an ISA device. Using IS_ENABLED() to omit the code paths
makes the code a bit confusing and doesn't save much.

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-07-19 16:32:53 -07:00
H Hartley Sweeten ed7fd225ef staging: comedi: amplc_pc236: cleanup "find pci device" code
For aesthetic reasons, rename the function and pass the
comedi_devconfig struct instead of pre-parsing out the bus/slot
information.

Use for_each_pci_dev() instead of open-coding the loop using
pci_get_device().

Consolidate the dev_err messages when a pci device is not found.

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-07-19 16:32:52 -07:00
H Hartley Sweeten b5e6df11f4 staging: comedi: amplc_dio200: 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.

Since the pci_dev is no longer held in the provate data, we can
also cleanup the detach a bit. Remove the IS_ENABLED() tests in
the detach. If the pci_dev is non NULL it's a PCI device otherwise
it's an ISA device. Using IS_ENABLED() to omit the code paths
makes the code a bit confusing and doesn't save much.

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-07-19 16:32:52 -07:00
H Hartley Sweeten dd90576838 staging: comedi: amplc_dio200: cleanup "find pci device" code
For aesthetic reasons, rename the function and pass the
comedi_devconfig struct instead of pre-parsing out the bus/slot
information.

Use for_each_pci_dev() instead of open-coding the loop using
pci_get_device().

Consolidate the dev_err messages when a pci device is not found.

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-07-19 16:32:52 -07:00
H Hartley Sweeten c2eb50bbdb staging: comedi: cb_pcidio: 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-07-19 16:32:52 -07:00
H Hartley Sweeten 2329a10c3f staging: comedi: cb_pcidio: cleanup "find pci device" code
Add a couple local variables to make the tests more concise.
Reorder the tests to make the for() loop checking for a
matching boardtype quicker.

Drop the dev_dbg for a match. It's just add noise.
Reword the dev_err when no match is found.

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-07-19 16:32:52 -07:00
H Hartley Sweeten 41f7ea34f5 staging: comedi: cb_pcidio: factor out the "find pci device" code
Factor the "find pci device" code out of the attach 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-07-19 16:32:52 -07:00
H Hartley Sweeten ba36b9ba76 staging: comedi: cb_pcidas: 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-07-19 16:19:43 -07:00
H Hartley Sweeten 983ff48833 staging: comedi: adv_pci_dio: 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-07-19 16:19:43 -07:00
H Hartley Sweeten 096de334d9 staging: comedi: adv_pci_dio: cleanup "find pci device" code
Add a couple local variables to make the tests more concise.
Reorder the tests to make the for() loop checking for a
matching boardtype quicker.

Drop the dev_dbg message for a match. It's just add 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-07-19 16:19:42 -07:00
H Hartley Sweeten e10355b946 staging: comedi: adv_pci_dio: remove CheckAndAllocCard()
This driver creates a linked list of all the pci devices in
the system while it's looking for a match. It's only use is
to determine if a device is "free" to use. The pci_is_enabled()
helper can give us the same information. Use that instead and
remove the linked list.

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-07-19 16:19:42 -07:00
H Hartley Sweeten 54b303c45d staging: comedi: adv_pci_dio: factor out the "find pci device" code
Factor the "find pci device" code out of the attach 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-07-19 16:19:42 -07:00
H Hartley Sweeten ad37c85c44 staging: comedi: adv_pci1710: 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-07-19 16:19:42 -07:00
H Hartley Sweeten 5f5d1b9ac1 staging: comedi: adv_pci1710: move comedi_pci_enable() into the attach
Use pci_is_enabled() in the "find pci device" function to determine if
the found pci device is not in use and move the comedi_pci_enable() call
into the attach.

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-07-19 16:19:42 -07:00
H Hartley Sweeten 5aa53d5f2e staging: comedi: adv_pci1710: cleanup "find pci device" code
Use for_each_pci_dev() instead of open-coding the loop using
pci_get_device().

Drop the printk error messages. They just add 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-07-19 16:19:42 -07:00
H Hartley Sweeten 96554c81d5 staging: comedi: adv_pci1710: factor out the "find pci device" code
Factor the "find pci device" code out of the attach 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-07-19 16:19:41 -07:00
H Hartley Sweeten dbe85f1757 staging: comedi: adv_pci1723: 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-07-19 16:19:41 -07:00
H Hartley Sweeten cc04c8a5fc staging: comedi: adv_pci1723: move comedi_pci_enable() into the attach
Use pci_is_enabled() in the "find pci device" function to determine if
the found pci device is not in use and move the comedi_pci_enable() call
into the attach.

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-07-19 16:19:41 -07:00
H Hartley Sweeten 3dbd666ca4 staging: comedi: adv_pci1723: cleanup "find pci device" code
Use for_each_pci_dev() instead of open-coding the loop using
pci_get_device().

Drop the printk error messages. They just add 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-07-19 16:19:41 -07:00