Commit graph

388131 commits

Author SHA1 Message Date
H Hartley Sweeten
0b20d613af staging: comedi: usbdux: remove usb_device back pointer from private data
The usb_device can be found when needed using the comedi_to_usb_dev()
helper. Use that instead the remove the back pointer 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>
2013-07-25 13:15:37 -07:00
H Hartley Sweeten
11642c658f staging: comedi: usbdux: pass comedi_device pointer to usbdux_alloc_usb_buffers()
For aesthetic reasons, pass the comedi_device pointer to this function
instead of the private data 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>
2013-07-25 13:15:36 -07:00
H Hartley Sweeten
fb90856828 staging: comedi: usbdux: tidy up receive_dux_commands()
For aesthetic reasons, pass the comedi_device pointer to this function
instead of the private data pointer. Rename the local variable used
for the private data pointer to the comedi "norm".

Add a local variable for the usb_device pointer to tidy up the
usb_bulk_msg() call.

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>
2013-07-25 13:15:36 -07:00
H Hartley Sweeten
49cc49dd9e staging: comedi: usbdux: tidy up send_dux_commands()
For aesthetic reasons, pass the comedi_device pointer to this function
instead of the private data pointer. Rename the local variable used
for the private data pointer to the comedi "norm".

Add a local variable for the usb_device pointer to tidy up the
usb_bulk_msg() call.

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>
2013-07-25 13:15:36 -07:00
H Hartley Sweeten
5d293d904c staging: comedi: usbdux: remove 'interface' from private data
This back pointer is only used for a couple dev_printk() messages and
during the detach.

For the dev_printk() we can use the dev->class_dev. In the detach we
can get the usb_interface from the comedi_device.

Do that and remove the back pointer 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>
2013-07-25 13:15:36 -07:00
H Hartley Sweeten
cc8cb3da9e staging: comedi: usbdux: remove 'comedidev' from private data
This back pointer is no longer needed by the driver. 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>
2013-07-25 13:15:36 -07:00
H Hartley Sweeten
5a80fa0429 staging: comedi: usbdux: tidy up usbduxsub_submit_pwm_urbs()
Pass the comedi_device pointer (the urb context) to this function
instead of the private data pointer.

Use a local variable for the urb pointer that is setup and submitted.

Remove the sanity check of the private data. This function can only
get called if the allocation was successful during 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>
2013-07-25 13:15:36 -07:00
H Hartley Sweeten
6754698b6a staging: comedi: usbdux: tidy up usbduxsub_submit_outurbs()
Pass the comedi_device pointer (the urb context) to this function
instead of the private data pointer.

Use a local variable for the urb pointers that are setup and submitted.

Remove the sanity check of the private data. This function can only
get called if the allocation was successful during 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>
2013-07-25 13:15:35 -07:00
H Hartley Sweeten
865d9eedd1 staging: comedi: usbdux: tidy up usbduxsub_submit_inurbs()
Pass the comedi_device pointer (the urb context) to this function
instead of the private data pointer.

Use a local variable for the urb pointers that are setup and submitted.

Remove the sanity check of the private data. This function can only
get called if the allocation was successful during 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>
2013-07-25 13:15:30 -07:00
H Hartley Sweeten
91aa6b2193 staging: comedi: usbdux: remove dev_printk() noise
Most of these are just function trace noise. The rest report errors
that the user can't do anything about so they amount to added 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>
2013-07-25 13:15:26 -07:00
H Hartley Sweeten
38691ec110 staging: comedi: usbdux: tidy up the comedi_lrange tables
Cleanup the whitespace in the tables.

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>
2013-07-25 13:15:26 -07:00
H Hartley Sweeten
e5acdc3561 staging: comedi: usbdux: remove the SUBDEV_* defines
These defines are only used to index the dev->subdevices array
during the attach. It's cleaner to just open-code the values.

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>
2013-07-25 13:15:26 -07:00
H Hartley Sweeten
c9f3363a30 staging: comedi: usbdux: tidy up usbduxsub_pwm_irq()
Rename the local variables to the comedi "norm".

Use dev->class_dev as the device for all dev_printk() messages.

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>
2013-07-25 13:15:26 -07:00
H Hartley Sweeten
e057288ffd staging: comedi: usbdux: tidy up usbduxsub_ao_isoc_irq()
Rename the local variables to the comedi "norm".

The comedi_subdevice in this function is actually the dev->write_subdev
that was initialized in the attach. Use that instead of accessing the
dev->subdevices array directly.

Use dev->class_dev as the device for all dev_printk() messages.

Instead of using the 'comedidev' back pointer in the private data, use
the comedi_device 'dev' that we already have.

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>
2013-07-25 13:15:26 -07:00
H Hartley Sweeten
0a9502f2c3 staging: comedi: usbdux: tidy up usbduxsub_ai_isoc_irq()
Rename the local variables to the comedi "norm".

The comedi_subdevice in this function is actually the dev->read_subdev
that was initialized in the attach. Use that instead of accessing the
dev->subdevices array directly.

Use dev->class_dev as the device for all dev_printk() messages.

Instead of using the 'comedidev' back pointer in the private data, use
the comedi_device 'dev' that we already have.

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>
2013-07-25 13:15:26 -07:00
H Hartley Sweeten
cc84f4f980 staging: comedi: usbdux: absorb usbdux_attach_common into caller
This function is only called by usbdux_auto_attach(), absorb it.

Also, there is no reason to down/up the semaphore during the attach.
None of the subdevices are functioning yet so there are no commands
being sent to the usb device.

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>
2013-07-25 13:15:25 -07:00
H Hartley Sweeten
72db740fd9 staging: comedi: usbdux: tidy up usbdux_attach_common()
Rename the local variable used for the device private data.

Move the setting of the device private data 'comedidev' to the
(*auto_attach) where the other back pointers are set.

Tidy up the subdevice init by removing the unnecessary comments
and adding some whitespace.

Remove the unnecessary dev_info() after a sucessful 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>
2013-07-25 13:15:25 -07:00
H Hartley Sweeten
ee9c2dd35c staging: comedi: usbdux: remove NOISY_DUX_DEBUGBUG
This define enables printing of the 'dux_commands' that is sent to
the usb device in send_dux_commands(). This type of development
debug should not be left in the final 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>
2013-07-25 13:15:25 -07:00
H Hartley Sweeten
8ff14ee8a6 staging: comedi: usbdux: cleanup the (*detach)
The tidy_up() function is only called by the (*detach). That function
unlinks any running urbs and frees all the allocated urbs and buffers
used by the driver.

Rename tidy_up() to usbdux_free_usb_buffers() and move all the parts
that don't deal with the freeing of the buffers directly into the
(*detach).

Also, remove all the unnecessary clearing of the pointers. The comedi
core will kfree() the private data after calling the (*detach).

Foe aesthetic reasons, do the kfree()'ing of the buffers and urbs in
the reverse order that they were allocated.

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>
2013-07-25 13:15:25 -07:00
H Hartley Sweeten
29d0c07428 staging: comedi: usbdux: remove unnecessary tidy_up() calls
If the comedi_driver (*auto_attach) fails, the comedi core will call
the (*detach) function to do any cleanup. It's not necessary to do
the cleanup in the (*auto_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>
2013-07-25 13:15:25 -07:00
H Hartley Sweeten
ef1ee8cf12 staging: comedi: usbdux: push usb (*probe) into comedi (*auto_attach)
The usb_driver (*probe) calls comedi_usb_auto_config() after finding a
free slot for the static private data and doind some initial allocation
and setup. The comedi_usb_auto_config() will then call the comedi_driver
(*auto_attach).

Move all the probe/auto_attach into the comedi_driver and just have the
usb_driver call comedi_usb_auto_config(). This allows the comedi_driver
to allocate the private data and removes the need for the static array
and the semaphore that protects it.

Since all the probe/auto_attach is now handled by the comedi_driver, we
can also remove the 'attached' and 'probed' information from the private
data. The subdevice functions will only be hooked up if the usb device
has been probed and the comedi device is attached.

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>
2013-07-25 13:15:25 -07:00
H Hartley Sweeten
a7dd65f57c staging: comedi: usbdux: push usb (*disconnect) into comedi (*detach)
The usb_driver (*disconnect) calls comedi_usb_auto_unconfig() which will
call the comedi_driver (*detach). Just move all the disconnect/detach
into the comedi_driver and use comedi_usb_auto_unconfig() directly for
the (*disconnect).

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>
2013-07-25 13:15:24 -07:00
H Hartley Sweeten
080bcc1887 staging: comedi: usbdux: move usb buffer allocation into new function
Move all the usb buffer allocation code in the usb_driver (*probe)
into a new function, usbdux_alloc_usb_buffers(). This allows tidying
up the error path in the (*probe).

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>
2013-07-25 13:15:24 -07:00
H Hartley Sweeten
da9035908e staging: comedi: usbdux: tidy up usbdux_usb_probe()
Use a pointer to the struct usbdux_private data being configured
in the probe. Also use a pointer to the struct urb being setup in
the buffer allocations.

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>
2013-07-25 13:15:24 -07:00
H Hartley Sweeten
b0daed19f2 staging: comedi: usbdux: remove the usb_driver (*probe) noise
The dev_dbg() during the usb_driver (*probe) is just added noise.

The dev_err() when a usb_alloc_urb() fails is not necessary. The
allocation failure will have already output a 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>
2013-07-25 13:15:24 -07:00
H Hartley Sweeten
40f1a5ab5e staging: comedi: usbdux: rename struct usbduxsub
This struct is the comedi_device private data. For aesthetic reasons,
rename it to usbdux_private.

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>
2013-07-25 13:15:24 -07:00
Sachin Kamat
7382b5cde6 staging: gdm724x: Remove version.h header inclusion in gdm_usb.h
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:11:58 -07:00
Sachin Kamat
649bf7f98b staging: gdm724x: Remove version.h header inclusion in gdm_usb.c
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:11:58 -07:00
Sachin Kamat
8f0b54478a staging: gdm724x: Remove version.h header inclusion in gdm_tty.h
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:11:58 -07:00
Sachin Kamat
c47a5863b6 staging: gdm724x: Remove version.h header inclusion in gdm_tty.c
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:11:58 -07:00
Sachin Kamat
3d2bf0fa5f staging: gdm724x: Remove version.h header inclusion in gdm_mux.c
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:11:58 -07:00
Sachin Kamat
c1636ab01b staging: gdm724x: Remove version.h header inclusion in gdm_lte.h
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:11:58 -07:00
Sachin Kamat
1bf4d4860e staging: gdm724x: Remove version.h header inclusion in gdm_lte.c
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:11:57 -07:00
Xiong Zhou
7b117940f3 staging/lustre: add BLOCK depends in Kconfig
Add BLOCK depends in Kconfig for LUSTRE to fix this:
drivers/staging/lustre/lustre/fid/../include/linux/lustre_compat25.h:117:2:
error: implicit declaration of function ‘unregister_blkdev’

Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:03 -07:00
Sachin Kamat
af7c25588f staging: lustre: obdclass: Remove duplicate header file inclusion
Removed the header file included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:03 -07:00
Sachin Kamat
b9cb7fed5e staging: lustre: Remove duplicate header file inclusion in lvfs_linux.c
Removed the header file included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:03 -07:00
Sachin Kamat
713542a8cd staging: lustre: Remove duplicate header file inclusion in lmv_obd.c
Removed the header file included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:03 -07:00
Sachin Kamat
c92b5ea0af staging: lustre: Remove duplicate header file inclusion in lmv_intent.c
Removed the header file included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:02 -07:00
Sachin Kamat
0c050588a2 staging: lustre: Remove duplicate header file inclusion in lmv_fld.c
Removed the header file included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:02 -07:00
Sachin Kamat
1fabbd6f65 staging: lustre: Remove duplicate header file inclusion in rw26.c
Removed the header files included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:02 -07:00
Sachin Kamat
ee49576196 staging: lustre: Remove duplicate header file inclusion in rw.c
Removed the header files included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:02 -07:00
Sachin Kamat
f75b7d2d69 staging: lustre: Remove duplicate header file inclusion in lloop.c
Removed the header files included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:02 -07:00
Sachin Kamat
0ad531db6c staging: lustre: Remove duplicate header file inclusion in llite_mmap.c
Removed the header files included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:02 -07:00
Sachin Kamat
2950b2416f staging: lustre: Remove duplicate header file inclusion in dir.c
Removed the header files included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:01 -07:00
Sachin Kamat
66270ce4e1 staging: lustre: linux-tcpip: Remove duplicate header file inclusion
Removed the header files included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:01 -07:00
Sachin Kamat
03f278994c staging: lustre: libcfs: Remove duplicate inclusion of header file
Removed the header files included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:01 -07:00
Sachin Kamat
6a4b8447cf staging: lustre: linux-debug: Remove duplicate inclusion of header file
Removed the header files included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:01 -07:00
Sachin Kamat
86664eb13e staging: lustre: obd: Remove duplicate inclusion of header file
Removed the header file included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:01 -07:00
Sachin Kamat
34d739605e staging: lustre: socklnd: Remove duplicate inclusion of header files
Removed the header files included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:01 -07:00
Sachin Kamat
a772bbeeea staging: lustre: o2iblnd: Remove duplicate inclusion of header file
Removed the header files included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 12:09:00 -07:00