Lisa Nguyen [Thu, 23 May 2013 20:53:43 +0000 (13:53 -0700)]
staging/silicom/bypasslib: Add space around ||
Added space around piping symbols to resolve checkpatch errors and
meet kernel coding standards in bplibk.h
Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lisa Nguyen [Thu, 23 May 2013 20:53:12 +0000 (13:53 -0700)]
staging/silicom/bypasslib: Add space around &&
Added space around double ampersands to resolve checkpatch errors
and meet kernel coding standards in bplibk.h
Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lisa Nguyen [Thu, 23 May 2013 20:52:41 +0000 (13:52 -0700)]
staging/silicom/bypasslib: Add space around ==
Added space around equal signs to resolve checkpatch errors and
meet kernel coding standards in bplibk.h
Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lisa Nguyen [Thu, 23 May 2013 20:52:17 +0000 (13:52 -0700)]
staging/silicom/bypasslib: Fix code indentation errors
Fixed code indentation errors generated by checkpatch.pl to
meet kernel coding standards in bplibk.h
Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lisa Nguyen [Thu, 23 May 2013 20:51:43 +0000 (13:51 -0700)]
staging/silicom/bypasslib: Reformat comments
Resolved the C99 comment style issue by reformatting existing comments
to meet kernel coding standards in bp_ioctl.h
Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Markus Niebel [Mon, 27 May 2013 08:19:11 +0000 (10:19 +0200)]
staging: drm/imx: revert vsync_cnt for di->id 1
partial fix of changes from
"staging: drm/imx: Add support for VGA via TVE on i.MX53"
parallel display support / DVI needs the original setting to work
Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Rogerio Pimentel <rpimentel.silva@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Markus Niebel [Mon, 27 May 2013 08:19:10 +0000 (10:19 +0200)]
staging: drm/imx: fix spelling error for vsync flag config
partial fix of changes from
"staging: drm/imx: Add support for VGA via TVE on i.MX53"
Have to check for vsync_pin instead of hsync_pin to set Vsync_pol.
Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Rogerio Pimentel <rpimentel.silva@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Markus Niebel [Mon, 27 May 2013 08:19:09 +0000 (10:19 +0200)]
staging: drm/imx: set correct sync pins for display
partial fix of changes from
"staging: drm/imx: Add support for VGA via TVE on i.MX53"
Have to call imx_drm_crtc_panel_format_pins in imx_drm_crtc_panel_format
with the correct pins instead of (0, 0) This enables configuration of
correct waveforms for vsync / hsync for parallel display, LDB (i.MX53 and
i.MX6) as well as HDMI and MIPI (i.MX6)
TODO: configure pins via device tree
Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Devendra Naga [Sun, 26 May 2013 03:04:16 +0000 (23:04 -0400)]
staging: btmtk_usb: check for a valid io_buf pointer
assigned to retval of kmalloc but not checked whether the allocation failed or not,
fail the registering if allocation fail
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Zimmerman [Fri, 24 May 2013 23:32:12 +0000 (16:32 -0700)]
staging: dwc2: change some dev_dbg() messages to dev_vdbg()
Change some dev_dbg() messages in dwc2_hcd_hub_control() to
dev_vdbg(), to prevent massive spew to the dmesg log when a device
is disconnected.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Harsh Kumar [Thu, 30 May 2013 05:48:12 +0000 (11:18 +0530)]
Staging: winbond: Made local functions static
Few functions are used only in one file. They are not included in any
other .h or .c files (I used grep to check). They seem to be local functions.
So, I have made them static.
I have also inlined one function as it is a one line function.
Signed-off-by: Harsh Kumar <harsh1kumar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Harsh Kumar [Thu, 30 May 2013 04:35:02 +0000 (10:05 +0530)]
Staging: winbond: usb_free_urb(NULL) is safe
usb_free_urb(NULL) is safe. So, the check was removed. Also, couple of checkpatch.pl fixes
Signed-off-by: Harsh Kumar <harsh1kumar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Joe Perches [Wed, 29 May 2013 02:44:24 +0000 (19:44 -0700)]
staging: fwserial: Use normal logging styles
Logging messages without newline termination are subject
to interleaving by other messages.
Avoid this by adding newlines to each message.
Neaten fwtty_<level> logging macros.
Convert driver_err to pr_err.
Add #define pr_fmt to prefix those messages.
Remove now unused driver_err macro.
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:16 +0000 (23:59 +0300)]
staging: xgifb: vb_setmode: delete IF_DEF_CRT2Monitor checks
Code checking for IF_DEF_CRT2Monitor is only executed for chips < XG20,
and there IF_DEF_CRT2Monitor is always true, so the flag is redundant.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:15 +0000 (23:59 +0300)]
staging: xgifb: vb_setmode: delete IF_DEF_HiVision checks
Code checking for IF_DEF_HiVision is only executed for chips < XG20,
and there IF_DEF_HiVision is always true, so the flag is redundant.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:14 +0000 (23:59 +0300)]
staging: xgifb: vb_setmode: delete IF_DEF_YPbPr checks
Code checking for IF_DEF_YPbPr is only executed for chips < XG20, and
there IF_DEF_YPbPr is always true, so the flag is redundant.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:13 +0000 (23:59 +0300)]
staging: xgifb: delete redundant return statements
Delete redundant return statements at the end of void functions.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:12 +0000 (23:59 +0300)]
staging: xgifb: XGI_DisableBridge(): delete redundant checks
Delete some redudant checks.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:11 +0000 (23:59 +0300)]
staging: xgifb: XGI_EnableChISLCD(): delete trivial function
The function returns always false, delete it.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:10 +0000 (23:59 +0300)]
staging: xgifb: SetFlag: delete EnableChA
This flag is never set, so checks can be removed and code behind it
deleted.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:09 +0000 (23:59 +0300)]
staging: xgifb: SetFlag: delete DisableChA
This flag is never set, so checks can be removed and code behind it
deleted.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:08 +0000 (23:59 +0300)]
staging: xgifb: SetFlag: delete EnableChB
This flag is never set, so checks can be removed and code behind it
deleted.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:07 +0000 (23:59 +0300)]
staging: xgifb: SetFlag: delete DisableChB
This flag is never set, so checks can be removed and code behind it
deleted.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:06 +0000 (23:59 +0300)]
staging: xgifb: SetFlag: delete GatingCRT
This flag is never set, so checks can be removed and code behind it
deleted.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:05 +0000 (23:59 +0300)]
staging: xgifb: XGI_SetCRT1VCLK(): avoid copy-paste
Avoid copy-pasted code in if branches by rearranging the checks.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:04 +0000 (23:59 +0300)]
staging: xgifb: XGI_GetRatePtrCRT2(): delete IF_DEF_LVDS check
IF_DEF_LVDS cannot be set if ProgrammingCRT2 flag is set, so remove the
check to simplify the code.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:03 +0000 (23:59 +0300)]
staging: xgifb: XGI_AjustCRT2Rate(): delete IF_DEF_LVDS check
IF_DEF_LVDS cannot be set when XGI_AjustCRT2Rate() is called, so we can
remove the check and dead code.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:02 +0000 (23:59 +0300)]
staging: xgifb: call XGI_GetVBType from InitTo330Pointer
Move XGI_GetVBType call inside InitTo330Pointer to avoid code duplication.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:01 +0000 (23:59 +0300)]
staging: xgifb: XGI_GetVBType(): delete IF_DEF_LVDS check
XGI_GetVBType() is called only for chips < XG20 so IF_DEF_LVDS cannot
be set.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 29 May 2013 20:59:00 +0000 (23:59 +0300)]
staging: xgifb: refactor XGI_BridgeIsOn()
Refactor XGI_BridgeIsOn(). IF_DEF_LVDS bit is not valid for < XG20 chips.
Also we can make the function static by moving it to vb_init.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peng Tao [Wed, 29 May 2013 13:40:56 +0000 (21:40 +0800)]
staging/lustre: fix LBUG and inode refcount bug
ldlm_proc_setup and ldlm_proc_cleanup should reset global
pde pointers otherwise remount may hit
LASSERT(ldlm_ns_proc_dir == NULL);
Also in libcfs_sock_ioctl, fput() includes itself sock_release.
So don't call sock_release twice otherwise kernel may oops
due to incorrect inode ref counting.
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peng Tao [Wed, 29 May 2013 13:40:55 +0000 (21:40 +0800)]
staging/lustre: adapt proc_dir_entry change
In 3.10 merge window, proc_dir_entry is now private to proc. However,
Lustre lprocfs depends heavily on it and its now-gone read_proc_t and
write_proc_t members.
The patch largely changed the fact, and made lprocfs depend on none of
proc_dir_entry private members. All lprocfs callers are converted to
use the new seq_file scheme.
Also lprocfs_srch is removed so that we can drop lprocfs_lock. All callers
are changed to save created pde in proper place.
See https://jira.hpdd.intel.com/browse/LU-3319 for more details.
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peng Tao [Wed, 29 May 2013 13:40:54 +0000 (21:40 +0800)]
staging/lustre: fix build error
We missed one file...
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Wed, 29 May 2013 08:12:18 +0000 (11:12 +0300)]
Staging: rtl8192e: fix an endian bug
Passing the high bits of "ratr_value" to rtl8192_config_rate() only
works on little endian systems. We should be passing a u16 value.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Wed, 29 May 2013 06:57:36 +0000 (09:57 +0300)]
Staging: rtl8192e: printing the wrong array
Smatch complained that there is an array overflow here. It looks
like we are supposed to be printing the ->rates_ex[] array which is
slightly larger than the ->rates[] array. This is a cut and paste
error.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Wed, 29 May 2013 06:56:00 +0000 (09:56 +0300)]
Staging: rtl8192e: delete some dead cruft
I have removed some unneeded comments, some blank lines and some
unused macros.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wei Yongjun [Thu, 23 May 2013 09:28:05 +0000 (17:28 +0800)]
Staging: vt6655: add missing free_netdev() on error in hostap_enable_hostapd()
Add the missing free_netdev() before return from function
hostap_enable_hostapd() in the error handling case.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wei Yongjun [Thu, 23 May 2013 09:28:34 +0000 (17:28 +0800)]
staging: keucr: remove needless check before usb_free_coherent()
usb_free_coherent() is safe with NULL addr and this check is
not required.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten [Thu, 23 May 2013 20:09:45 +0000 (13:09 -0700)]
staging: comedi: usbduxsigma: tidy up the multi-line comments
Modify the multi-line comments to follow the CodingStyle.
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 [Thu, 23 May 2013 20:09:25 +0000 (13:09 -0700)]
staging: comedi: usbduxsigma: remove a space before tab
checkpatch.pl reports:
WARNING: please, no space before tabs
+^Ihigh_speed = 0; ^I/* (devpriv->high_speed) */$
Remove the space to avoid the warning.
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 [Thu, 23 May 2013 20:09:08 +0000 (13:09 -0700)]
staging: comedi: usbduxsigma: tidy up chanToInterval()
Rename the function to have namespace associated with the driver.
Rename the CamelCase parameter 'nChannels' to avoid the checkpatch.pl
warning.
Tidy up the function a bit.
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 [Thu, 23 May 2013 20:08:51 +0000 (13:08 -0700)]
staging: comedi: usbduxsigma: add missing spaces reported by checkpatch.pl
checkpatch.pl reports:
ERROR: space required after that ',' (ctx:VxV)
+ dev_dbg(dev->class_dev,"CRC error in ISO IN stream\n");
^
ERROR: spaces required around that '=' (ctx:VxW)
+ struct usbduxsigma_private *devpriv= dev->private;
^
Add the missing spaces to avoid the error.
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 [Thu, 23 May 2013 20:08:33 +0000 (13:08 -0700)]
staging: comedi: usbduxsigma: rename CamelCase vars in private data
Rename the CamelCase variables in the private data to avoid the
checkpatch.pl warning.
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 [Thu, 23 May 2013 20:08:14 +0000 (13:08 -0700)]
staging: comedi: usbduxsigma: remove some unused defines
These defines are not used in the driver. 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 [Thu, 23 May 2013 20:07:53 +0000 (13:07 -0700)]
staging: comedi: usbduxsigma: tidy up the usb endpoint defines
Rename the defines so they have namespace associated with the driver.
Tidy up the defines.
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 [Thu, 23 May 2013 20:07:35 +0000 (13:07 -0700)]
staging: comedi: usbduxsigma: cleanup comedi_lrange table
Rename the table so it has namespace associated with the driver.
Tidy up the whitespace of the table.
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 [Thu, 23 May 2013 20:07:14 +0000 (13:07 -0700)]
staging: comedi: usbduxsigma: rename usbdux_{ai,ao}_stop() functions
Rename the functions so they have namespace associated with the driver.
For aesthetic reasons, pass the comedi_device pointer instead of the
private data pointer as the first parameter.
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 [Thu, 23 May 2013 20:06:55 +0000 (13:06 -0700)]
staging: comedi: usbduxsigma: rename the (*cancel) functions
Rename these functions so they have namespace associated with the
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>
H Hartley Sweeten [Thu, 23 May 2013 20:06:37 +0000 (13:06 -0700)]
staging: comedi: usbduxsigma: rename the urb completion handlers
Rename these functions so they have namespace associated with the
driver and their use is aparent.
Also, rename the #defines used for the bulk transfer commands and
move them up with the other defines.
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 [Thu, 23 May 2013 20:06:18 +0000 (13:06 -0700)]
staging: comedi: usbduxsigma: rename {send,receive}_dux_commands()
Rename these functions so they have namespace associated with the
driver.
Also, rename the #defines used for the bulk transfer commands and
move them up with the other defines.
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 [Thu, 23 May 2013 20:05:59 +0000 (13:05 -0700)]
staging: comedi: usbduxsigma: check for invalid 'ao_timer' in all cases
Make sure to check that the 'ao_timer' value is valid for both the
high speed and low speed cases in usbduxsigma_ao_cmdtest().
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 [Thu, 23 May 2013 20:05:38 +0000 (13:05 -0700)]
staging: comedi: usbduxsigma: tidy up analog input command support
Rename the (*do_cmdtest) and (*do_cmd) functions so they have namespace
associated with the driver. Rename the local variable used for the
private data pointer.
Move all the command argument initialization and testing into the
(*do_cmdtest) function. That function is always called by the comedi
core before the (*do_cmd) function. The only thing the (*do_cmd) function
should have to do is setup the channel list, send the command to start
the analog input sampling, initialize the counter for the conversion,
then either read the acquisition data (submit the urbs) or set the
trigger to read the data later.
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 [Thu, 23 May 2013 20:05:19 +0000 (13:05 -0700)]
staging: comedi: usbduxsigma: tidy up usbdux_ai_insn_read()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Return -EBUSY if an asynchronous command is running and the read cannot
be completed.
Propagate the errno if the receive_dux_command() fails.
Tidy up the function to make it more concise.
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 [Thu, 23 May 2013 20:04:53 +0000 (13:04 -0700)]
staging: comedi: usbduxsigma: cleanup the private data 'outBuffer'
This buffer is used to cache the analog output values that are written
to the analog output channels. Currently it only caches the single
writes to the channels using the (*insn_write) callback. The async
command writes are not cached. The buffer is also being kzalloc'ed
during the attach of the driver to a size much larger that required.
Rename the CamelCase buffer and change it to an array in the private
data of the correct size to cache the analog output channel values.
Modify the analog output urb callback so it updates the cached values
with those used for the asynchronous command to allow readback after
the command 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 [Thu, 23 May 2013 20:04:31 +0000 (13:04 -0700)]
staging: comedi: usbduxsigma: tidy up analog output (*insn_{read, write})
Rename the functions so they have namespace associated with the driver.
Rename the local variable used for the private data pointer.
Return -EBUSY from the (*insn_write) function if an asynchronous command
is running that the write cannot be completed.
Don't save the cached value of the analog output for readback unless
the command to set it is successful.
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 [Thu, 23 May 2013 20:04:11 +0000 (13:04 -0700)]
staging: comedi: usbduxsigma: tidy up analog output command support
Rename the (*do_cmdtest) and (*do_cmd) functions so they have namespace
associated with the driver. Rename the local variable used for the
private data pointer.
Move all the command argument initialization and testing into the
(*do_cmdtest) function. That function is always called by the comedi
core before the (*do_cmd) function. The only thing the (*do_cmd) function
should have to do is setup the channel list, initialize the counter for
the conversion, then either start the conversion (submit the urbs) or
set the trigger to start the conversion.
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 [Thu, 23 May 2013 20:03:45 +0000 (13:03 -0700)]
staging: comedi: usbduxsigma: rename usbdux_pwm_stop()
Rename the function so it has namespace associated with the driver.
For aesthetic reasons, pass the comedi_device pointer instead of the
private data pointer as the first parameter.
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 [Thu, 23 May 2013 20:03:26 +0000 (13:03 -0700)]
staging: comedi: usbduxsigma: rename usbdux_pwm_cancel()
Rename the function so it has namespace associated with the 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>
H Hartley Sweeten [Thu, 23 May 2013 20:03:06 +0000 (13:03 -0700)]
staging: comedi: usbduxsigma: rename usbdux_pwm_irq()
Rename the function so it has namespace associated with the 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>
H Hartley Sweeten [Thu, 23 May 2013 20:02:45 +0000 (13:02 -0700)]
staging: comedi: usbduxsigma: tidy up usbdux_pwm_period()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Modify the fx2delay calculation to remove the floating point 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>
H Hartley Sweeten [Thu, 23 May 2013 20:02:25 +0000 (13:02 -0700)]
staging: comedi: usbduxsigma: change private data flags to bit fields
Change the type of all the true/false flags in the private data to
bit fields.
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 [Thu, 23 May 2013 20:01:56 +0000 (13:01 -0700)]
staging: comedi: usbduxsigma: remove 'interface' from the private data
This back pointer to the usb_interface is not used, 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>
H Hartley Sweeten [Thu, 23 May 2013 20:01:18 +0000 (13:01 -0700)]
staging: comedi: usbduxsigma: remove some dev_{level} noise
Remove the dev_err() and dev_dbg() messages that are just kernel
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>
H Hartley Sweeten [Thu, 23 May 2013 20:00:56 +0000 (13:00 -0700)]
staging: comedi: usbduxsigma: tidy up usbdux_dio_insn_config()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Add a local variable for the channel mask.
Remove the unnecessary comments and clean up the multi-line comment
at the end.
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 [Thu, 23 May 2013 20:00:36 +0000 (13:00 -0700)]
staging: comedi: usbduxsigma: tidy up usbdux_dio_insn_bits()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Remove the unnecessary casts.
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 [Thu, 23 May 2013 19:59:24 +0000 (12:59 -0700)]
staging: comedi: usbduxsigma: tidy up usbdux_pwm_start()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Remove the unnecessary cast of the pwm delay.
Use memset to initialize the buffer instead of the for loop.
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 [Thu, 23 May 2013 19:58:43 +0000 (12:58 -0700)]
staging: comedi: usbduxsigma: tidy up usbdux_pwm_pattern()
Rename the function so it has namespace associated with the driver.
Tidy up the function to make it more concise.
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 [Thu, 23 May 2013 19:58:23 +0000 (12:58 -0700)]
staging: comedi: usbduxsigma: tidy up usbdux_pwm_write()
Rename the function so it has namespace associated with the driver.
Tidy up the comments.
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 [Thu, 23 May 2013 19:58:04 +0000 (12:58 -0700)]
staging: comedi: usbduxsigma: remove usbdux_pwm_read()
The comment says its not needed, 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>
H Hartley Sweeten [Thu, 23 May 2013 19:57:45 +0000 (12:57 -0700)]
staging: comedi: usbduxsigma: tidy up usbduxsigma_pwm_config()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Remove some unnecessary comments and tidy up the comment about the
parameters for the INSN_CONFIG_PWM_SET_H_BRIDGE instruction.
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 [Thu, 23 May 2013 19:57:25 +0000 (12:57 -0700)]
staging: comedi: usbduxsigma: move usbduxsigma_firmware_upload()
For aesthetics, move this function near its caller. Also, move the
FIRMWARE_MAX_LEN define so its with the other firmware constants
and fix the whitespace.
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 [Thu, 23 May 2013 19:56:59 +0000 (12:56 -0700)]
staging: comedi: usbduxsigma: remove an extra ';'
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 [Thu, 23 May 2013 19:56:36 +0000 (12:56 -0700)]
staging: comedi: usbduxsigma: tidy up tidy_up()
Rename the function so it has namespace associated with the driver.
For aesthetic reasons, move the function so it's near the one that
allocates the usb buffers.
Tidy up the function so it frees the buffers in the opposite order
they were allocated. Also remove the = NULL for all the buffers,
the driver is being detached so the comedi core will kfree 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>
H Hartley Sweeten [Thu, 23 May 2013 19:56:12 +0000 (12:56 -0700)]
staging: comedi: usbduxsigma: kill all urbs before freeing them
For aesthetic reasons, kill all the urbs before freeing them.
Also, remove a redundant killing of the ai and ao urbs in the
(*detach).
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 [Thu, 23 May 2013 19:55:48 +0000 (12:55 -0700)]
staging: comedi: usbduxsigma: move usb_set_intfdata(intf, NULL) to (*detach)
For aesthetic reasons, move the clearing of the interface data to
the (*detach) since its set 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>
H Hartley Sweeten [Thu, 23 May 2013 19:55:28 +0000 (12:55 -0700)]
staging: comedi: usbduxsigma: remove tidy_up() from (*auto_attach)
Comedi drivers do not need to cleanup allocations during the
(*auto_attach). If the (*auto_attach) fails the (*detach) will
automatically be called to handle the cleanup.
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 [Thu, 23 May 2013 19:55:08 +0000 (12:55 -0700)]
staging: comedi: usbduxsigma: tidy up usbdux_getstatusinfo()
Rename the function so it has namespace associated with the driver.
Move the function closer to its only caller and tidy it up a bit.
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 [Thu, 23 May 2013 19:54:49 +0000 (12:54 -0700)]
staging: comedi: usbduxsigma: tidy up usbduxsigma_attach_common()
Rename the local variable used for the comedi_device private data.
Remove all the unnecessary comments and add some whitespace to the
subdevice init.
Use dev->class_dev for the dev_{level} 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>
H Hartley Sweeten [Thu, 23 May 2013 19:54:25 +0000 (12:54 -0700)]
staging: comedi: usbduxsigma: remove SUBDEV_* defines
The SUBDEV_* defines are only used during the (*auto_attach). Remove
the defines and 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>
H Hartley Sweeten [Thu, 23 May 2013 19:54:06 +0000 (12:54 -0700)]
staging: comedi: usbduxsigma: remove unnecessary check in usbdux_ao_cmd()
The comedi core verifies that the command chanlist_len is valid for
the subdevice based on the len_chanlist that was setup during the
attach. There is no need to recheck it in the (*cmd) 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 [Thu, 23 May 2013 19:53:46 +0000 (12:53 -0700)]
staging: comedi: usbduxsigma: remove unnecessary check in usbdux_ai_cmd()
The comedi core verifies that the command chanlist_len is valid for
the subdevice based on the len_chanlist that was setup during the
attach. There is no need to recheck it in the (*cmd) 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 [Thu, 23 May 2013 19:53:23 +0000 (12:53 -0700)]
staging: comedi: usbduxsigma: tidy up usbdux_ai_inttrig()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Remove the dev_err() messages, they are just 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>
H Hartley Sweeten [Thu, 23 May 2013 19:52:59 +0000 (12:52 -0700)]
staging: comedi: usbduxsigma: tidy up usbdux_ao_inttrig()
Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.
Remove the dev_err() messages, they are just added noise.
Refactor the code to remove the goto.
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 [Thu, 23 May 2013 19:52:37 +0000 (12:52 -0700)]
staging: comedi: usbduxsigma: remove private data sanity checks
The comedi functions in this driver can only be called if the
(*auto_attach) successfull kzalloc'ed the private data and set
dev->private. The extra sanity checks are not needed. 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 [Thu, 23 May 2013 19:52:17 +0000 (12:52 -0700)]
staging: comedi: usbduxsigma: tidy up firmware upload error messages
Use dev->class_dev for all dev_{level} messages.
Remove the unnecessary error message for a kmemdup() failure.
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 [Thu, 23 May 2013 19:51:56 +0000 (12:51 -0700)]
staging: comedi: usbduxsigma: remove 'usbdev' from the private data
This back pointer to the usb_device is not needed in the private data.
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>
H Hartley Sweeten [Thu, 23 May 2013 19:51:37 +0000 (12:51 -0700)]
staging: comedi: usbduxsigma: remove 'comedidev' from the private data
This back pointer to the comedi_device is not needed in the private
data. 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>
H Hartley Sweeten [Thu, 23 May 2013 19:51:14 +0000 (12:51 -0700)]
staging: comedi: usbduxsigma: tidy up usbduxsub_submit_PwmURBs()
Rename the CamelCase function.
Pass the comedi_device pointer instead of the private data pointer
to the function.
Use a couple local variables to tidy up the function.
Remove the dev_err() message when usb_submit_urb() fails, its just
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>
H Hartley Sweeten [Thu, 23 May 2013 19:50:51 +0000 (12:50 -0700)]
staging: comedi: usbduxsigma: tidy up receive_dux_commands()
Rename the variable used for the private data pointer.
Remove dev_err() when usb_blk_msg() fails, it's just 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>
H Hartley Sweeten [Thu, 23 May 2013 19:50:31 +0000 (12:50 -0700)]
staging: comedi: usbduxsigma: tidy up send_dux_commands()
Rename the variable used for the private data pointer.
Remove dev_err() when usb_blk_msg() fails, it's just 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>
H Hartley Sweeten [Thu, 23 May 2013 19:50:08 +0000 (12:50 -0700)]
staging: comedi: usbduxsigma: remove NOISY_DUX_DEBUGBUG
This define enables a bunch of printk debug in send_dux_commands().
This is just noise used for development debuging. 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>
H Hartley Sweeten [Thu, 23 May 2013 19:49:50 +0000 (12:49 -0700)]
staging: comedi: usbduxsigma: push usb (*probe) into comedi (*auto_attach)
The usb_driver (*probe) already calls comedi_usb_auto_config(), which
will call the comedi_driver (*auto_attach). Move the bulk of the (*probe)
to the (*auto_attach).
This allows the comedi_device private data to be kzalloc'ed and the static
array used to pass the private data from the usb_driver to the comedi_driver
can be removed along with the static semaphore that protected it.
We can also drop a couple variables from the private data since they no
longer are used or needed.
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 [Thu, 23 May 2013 19:49:26 +0000 (12:49 -0700)]
staging: comedi: usbduxsigma: push usb (*disconnect) into comedi (*detach)
The usb_driver (*disconnect) already calls comedi_usb_auto_unconfig(), which
will call the comedi_driver (*detach). Move the other operations in the
(*disconnect) into the (*detach). The comedi_usb_auto_unconfig() can then
be used 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>
H Hartley Sweeten [Thu, 23 May 2013 19:49:02 +0000 (12:49 -0700)]
staging: comedi: usbduxsigma: factor usb buffer allocation out of (*probe)
To make pushing the usb_driver (*probe) into the comedi_driver (*auto_attach)
cleaner, factor the usb buffer allocation out of the (*probe). This also
cleans up the failure paths 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>
H Hartley Sweeten [Thu, 23 May 2013 19:48:41 +0000 (12:48 -0700)]
staging: comedi: usbduxsigma: tidy up usbduxsigma_usb_probe()
For aesthetic reasons, rename some of the variables to the "norm" used
in comedi drivers.
Use a local variable for the pointer to the private data instead of
accessing the static array directly. Also use a local variable to
setup the urbs.
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 [Thu, 23 May 2013 19:48:12 +0000 (12:48 -0700)]
staging: comedi: usbduxsigma: rename the private data struct
For aesthetic reasons, rename the struct used for the comedi_device
private data from usbduxsub to usbduxsigma_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>
H Hartley Sweeten [Thu, 23 May 2013 19:47:48 +0000 (12:47 -0700)]
staging: comedi: usbduxsigma: tidy up usbduxsub_pwm_irq()
Rename the local variables to follow the "norm" for comedi drivers.
The comedi_subdevice is not used in this function. Remove that local
variable.
Use dev->class_dev for any dev_{level} messages.
Remove the extra check of 'pwm_cmd_running' before submitting the urb.
This flag was previously checked.
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 [Thu, 23 May 2013 19:47:19 +0000 (12:47 -0700)]
staging: comedi: usbduxsigma: remove 'probed' checks in comedi functions
The 'probed' flag in the private data is used by the usb_driver (*probe)
function to find a free entry in the static usbduxsub array to use for
the comedi_device private data. The (*probe) sets this flag before it
hands off the probe to the comedi_driver (*auto_attach). The 'probed'
flag is cleared in tidy_up() are part of the usb_driver (*disconnect),
which calls the comedi_driver (*detach).
The 'probed' flag will always be set if the comedi_driver (*auto_attach)
completes successfully. The extra sanity checks in the comedi functions
are not needed. 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 [Thu, 23 May 2013 19:46:40 +0000 (12:46 -0700)]
staging: comedi: usbduxsigma: generalize the usb_submit_urb functions
Generalize a helper function to replace usbduxsub_submit_{In,Out}URBs().
In the callers, set the 'a[io]_cmd_running' flag after the urbs have been
successfully submitted. This removes the need to clear the flag if the
submit fails.
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 [Thu, 23 May 2013 19:46:17 +0000 (12:46 -0700)]
staging: comedi: usbduxsigma: remove dev_{level} messages in submit urbs functions
The usbduxsub_submit_{In,Out}URBs() functions have a couple development
debug messages that are just added noise. Remove them.
Also, the sanity check of 'usbduxsub', the comedi_device private data, is
not necessary. The callers have already validated it. Remove the 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>