- 01 Nov, 2012 40 commits
-
-
Ian Abbott authored
Change the `DEBUG_PRINT(format, args...)` macro used by this module to use either `pr_debug()` (if macro `HPDI_DEBUG` is defined) or `no_printk()` instead of `printk()` or nothing. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
When requesting PCI region resources and IRQ, use the board name as the resource owner string instead of the driver name. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
Change the type of the `name` member of `struct hpdi_board` from `char *` to `const char *` as it should not be modifiable. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
The `board(dev)` function just casts `dev->board_ptr` to a pointer to the private data type `struct hpdi_private` and returns it. It's only called from one function: `hpdi_auto_attach()`. Remove `board()` and use a local variable to point to the `struct hpdi_private` data structure. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
In `struct hpdi_private`, the `plx9080_phys_iobase` and `hpdi_phys_iobase` hold the physical memory addresses from the PCI BARs used by this driver. The physical addresses are only really needed when ioremapping the resources when the device is being attached by `hpdi_auto_attach()`. A non-zero value of the `hpdi_phys_iobase` is also used to indicate that a call to `comedi_pci_enable()` was successful so that `comedi_pci_disable()` should be called when the device is detached by `hpdi_detach()`. Remove the `plx9080_phys_iobase` and `hpdi_phys_iobase` members and use `dev->iobase` as a flag to indicate whether `comedi_pci_disable()` needs to be called by `hpdi_detach()`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
The `hw_dev` member of `struct hpdi_private` is used to point to the `struct pci_dev`. This is redundant as the `struct comedi_device` already has a pointer to the `struct device` within the `struct pci_dev` and there is a convenient inline function, `comedi_to_pci_dev(dev)` that returns a pointer to the `struct pci_dev`. Remove the redundant `hw_dev` member and use alternate ways to get at the `struct pci_dev`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
This driver does not need to support manual attachment of supported PCI devices. Replace the `attach()` hook (`hpdi_attach()`) with an `auto_attach()` hook (`hpdi_auto_attach()`). This will be called via `comedi_pci_auto_config()` at PCI probe time. This driver no longer increments the PCI reference during attachment, so remove the call to `pci_dev_put()` when detaching the device. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Devendra Naga authored
there are function definitions missing for these prototypes, so remove all 3 function protos. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Devendra Naga authored
these function prototypes are missing the function definition, remove them all. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Devendra Naga authored
the function definitions are missing for these prototypes, so remove all these. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Devendra Naga authored
sme_ap_config misses a check of the return of the sme_wait_for_reply as all other functions do here, for the return of sme_wait_for_reply add the check and fail if it returns other than 0. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Devendra Naga authored
remove the braces around single statement if blocks Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Devendra Naga authored
replace spaces at start of line with tabs in sme_mgt_tspec Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Devendra Naga authored
replace spaces at the beginning of the line with tabs in sme_mgt_packet_filter_set Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Devendra Naga authored
replace spaces with tabs at the start of line Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Devendra Naga authored
remove braces to single statement if blocks Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
This driver is an example of how to write a Comedi driver and includes some code for handling PCI devices, but not very much. It calls `comedi_pci_auto_config()` at PCI probe time. That normally expects to call the comedi driver's `auto_attach()` hook (or the deprecated `attach_pci()` hook), but will fall back to using the `attach()` hook that should only be used for attaching devices "manually" via the `COMEDI_DEVCONFIG` ioctl. Add an `auto_attach()` hook (`skel_auto_attach()`) to handle auto-attachment of supported PCI devices. Add comments to the `attach()` hook (`skel_attach()`) to indicate that it shouldn't generally allow PCI devices to be attached that way (and probably isn't needed at all for PCI-only Comedi drivers). Add code to the `detach()` hook (`skel_detach()`) to disable PCI devices enabled by the `auto_attach()` hook. `skel_auto_attach()` calls new function `skel_find_pci_board()` to find a matching element in `skel_boards[]`. PCI device ID information has been added to `skel_boards[]` to give the function something to look for. Remove the `pci_dev` member of `struct skel_private` as drivers now use the `hw_dev` member of `struct comedi_device` to get at the PCI device. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
Move `skel_pci_table[]` closer to `skel_pci_table` so it falls within the same `#ifdef`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
Move `skel_ns_to_timer()` up so it's forward declaration can be removed. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
Move `skel_attach()`, `skel_detach()` and `skel_driver` down the file so that a bunch of forward declarations can be removed. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
Use the `module_comedi_pci_driver()` macro to register the module as a comedi PCI driver instead of adding the boiler-plate code in full. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
Remove the `driver_` prefix from variable and function names. Rename `driver_skel` to `skel_driver`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
Use the dev_info() etc. instead of pr_info() etc. Remove a couple of them that seemed a bit pointless. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
This driver's `thisboard` macro relies on a local variable having a specific name. Replace it with a local variable of the same name in the functions that use it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
YAMANE Toshiaki authored
fixed below checkpatch warnings. - WARNING: printk() should include KERN_ facility level Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
YAMANE Toshiaki authored
fixed below checkpatch error. - ERROR: do not initialise statics to 0 or NULL Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
YAMANE Toshiaki authored
fixed below checkpatch warnings. - WARNING: please, no spaces at the start of a line Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Wei Yongjun authored
Remove including <linux/version.h> that don't need it. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Wei Yongjun authored
Remove including <linux/version.h> that don't need it. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
These are not used. Remove them. 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>
-
H Hartley Sweeten authored
These are defined in addi_common.h, the hwdrv_* files do not need to redefined them. 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>
-
H Hartley Sweeten authored
All these #include's have already been handled. 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>
-
H Hartley Sweeten authored
Now that the PCI bus walking has been removed from the addi-data drivers, the only differenced between addi_amcc_s9533.h and the standard comedi amcc_s5933.h is the additional defines for the apci3120 "ADDON RELATED ADDITIONS". Move those defines to hwdrv_apci3120.c. Modify all the addi-data drivers to then include the standard comedi amcc_s5933.h header and delete the duplicate in addi-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>
-
H Hartley Sweeten authored
This variable is only used in the detach of the addi-data boards to indicate that the attach of the board was successful and that the reset function can be called. We can use the dev->iobase variable to indicate this instead. Once this variable is set the attach always completes. 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>
-
H Hartley Sweeten authored
This variable is only used as a flag to indicate that the pci device has been enabled. Use the comedi_device 'iobase' variable to indicate this instead. This is how it's normally handled in the comedi pci drivers. Make the call to comedi_pci_disabled() in i_ADDI_Detach() common and move it to the end of the function. Both the if and else case require 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>
-
H Hartley Sweeten authored
Read the PCI bars directly into the private data variables and remove all the local variables used for them in addi_attach_pci(). 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>
-
H Hartley Sweeten authored
Use the comedi pci auto config mechanism to attach the addi-data drivers. This allows removing all the PCI bus walking code. Add a function, addi_find_boardinfo(), to find the driver specific boardinfo. Since this function is currently in the common code we have to use the pointer to the boardinfo that is stored in the comedi_driver pointer. 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>
-
H Hartley Sweeten authored
This function calls comedi_pci_disable() to disable the pci device when detached. It's only called from i_ADDI_Detach(). Move the code there and delete the 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>
-
H Hartley Sweeten authored
This pci driver currently uses the comedi legacy attach mechanism which allows the user to pass configuration options to the driver when it is attached to the comedi subsystem. The use of these configuration options is preventing the conversion of the addi-data drivers to the comedi auto attach mechanism. For the addi-data drivers, option[2] is used to enable/disable dma. The default (0) action is to enable dma is the driver supports it. Remove this configuration option and just enable dma if it is supported. 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>
-
H Hartley Sweeten authored
This information can be found when needed in i_ADDI_Attach() by using the pci_dev pointer. 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>
-