1
0
Fork 0
Commit Graph

349825 Commits (f951dd05f9549c9b1a16d4eabfe60c20721de292)

Author SHA1 Message Date
Peter Huewe f951dd05f9 staging/xgifb: Consolidate if branches with similar conditions
1) The same condition (pVBInfo->IF_DEF_LVDS == 0) was checked in the if
clause directly in front of this one.

2) The same condition pVBInfo->VBType & (VB_SIS301B | VB_SIS302B |
VB_SIS301LV | VB_SIS302LV | VB_XGI301C) was checked in the if
clause directly in front of this one.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:16:22 -08:00
Peter Huewe 826215d98f staging/xgifb: Consolidate if/else for 'identical' branches
Since XGI_LCDDesStruct is fully contained in XGI330_LCDDataDesStruct2
and the offsets for the first members is identical we can consolidate
the if/else branches here and use XGI330_LCDDataDesStruct2 for
everything.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:16:22 -08:00
Peter Huewe 1504ecbeec staging/xgifb: Don't write the same values x times
With the previous patch 'Move duplicated code for dram to helper
function' it becomes evident that the code is performing the same
thing 4 or 8 times in a row without changing arguments to the function
and thus writing the same values over and over again.

It was tested that these repeats are unnecessary.

-> we can safely remove them.

Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:16:21 -08:00
Peter Huewe 0141bb2ed9 staging/xgifb: Move duplicated code for dram to helper function
XGINew_SetDRAMDefaultRegister340 uses the same code fragment 4 times
with only a slight variation each time.
-> Move this code to a helper function - this saves some lines and
~450bytes in the .o / .ko

Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:16:21 -08:00
Peter Huewe 227dc1156c staging/xgifb: Replace XGI340_CR6B table with simple if/else
The XGI340_CR6B lookup table consists of the entries
{0xaa, 0xaa, 0xaa, 0xaa} for an index <= 2 and
{0x00, 0x00, 0x00, 0x00} for all other indices.

The only user XGINew_SetDRAMDefaultRegister340 loops over these 4 values
of a line with a for loop and since all entries are the same for each line
we can simply replace the whole lookup table with a simple if/else assignment.

Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 11:16:21 -08:00
H Hartley Sweeten 5056d87a88 staging: comedi: ni_daq_700: use comedi_pcmcia_disable() for (*detach)
The (*detach) function, daq700_detach() is now a simple wrapper around
comedi_pcmcia_disable(). Just use comedi_pcmcia_disable() directly for
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>
2013-02-04 14:47:19 -08:00
H Hartley Sweeten 7dc99109f5 staging: comedi: ni_daq_700: use comedi_pcmcia_{enable, disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA device.

This driver does not use interrupts and is not an audio device,
remove CONF_ENABLE_IRQ and CONF_AUTO_AUDIO from the link->config_flags.

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-02-04 14:47:19 -08:00
H Hartley Sweeten 95f932cea3 staging: comedi: das08_cs: use comedi_pcmcia_{enable, disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA device.

This driver does not use interrupts so remove CONF_ENABLE_IRQ from
the link->config_flags.

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-02-04 14:47:19 -08:00
H Hartley Sweeten 7fadd565f0 staging: comedi: cb_das16_cs: use comedi_pcmcia_disable() for (*detach)
The (*detach) function, das16cs_detach() is a simple wrapper around
comedi_pcmcia_disable(). Just use comedi_pcmcia_disable() directly
for 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>
2013-02-04 14:47:19 -08:00
H Hartley Sweeten bcd22e8ece staging: comedi: cb_das16_cs: use pcmcia_request_irq()
Use pcmcia_request_irq() instead of request_irq() to request the
irq for the PCMCIA device. This allows the PCMCIA core to clean
up the registration in pcmcia_disable_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-02-04 14:47:19 -08:00
H Hartley Sweeten 9e29ce104a staging: comedi: cb_das16_cs: use comedi_pcmcia_{enable, disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA 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-02-04 14:47:18 -08:00
H Hartley Sweeten ddb2d0a018 staging: comedi: comedi_pcmcia: introduce comedi_pcmcia_{enable, disable}
Introduce some helper functions to enable/disable the PCMCIA device.
This will allow removing some of the boilerplate code in the comedi
PCMCIA 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>
2013-02-04 14:47:18 -08:00
Peter Huewe e44adfdb67 staging/xgifb: Simplify XGISetModeNew
This patch simplifies the code of XGISetModeNew by reordering the
if/else if/case conditions when both branches are doing exactly the
same.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:28 -08:00
Peter Huewe 06cc47b90b staging/xgifb: Consolidate XGI_EnableChISLCD and XGI_DisableChISLCD
These two functions share the same code except one line - thus we can
simply merge them and add a parameter to switch between both variants.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:28 -08:00
Peter Huewe 5d1c2a9b28 staging/xgifb: Remove unnecessary bitshifts in XGI_SetCRT1ModeRegs
Since data can only be 0x0000, 0x0035 or 0x0048 we can simply skip the
bit shifting and masking as data & 0xFF is always equal to data and
data & 0xFF00 is always 0.
So we simply use data and 0 directly and save the assignment.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:28 -08:00
Peter Huewe a5e080b83e staging/xgifb: remove unnecessary temp variable in XGIfb_mode_rate_to_ddata
Instead of subtracting one and then assign a different name and add 1
again we simply use HDE directly. HDE wasn't used directly before, so no
change in functionality.
Same applies to VDE.

-> now we can remove the variable with the very descriptive name E ;)

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe bae31702cd staging/xgifb: rewrite XGIfb_get_cmap_len
We don't need to use this switch-case here for a simple two case
if-else.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe 76a5899b0c staging/xgifb: Simplify XGI_SetSeqRegs
Since SR[0] in the (readonly) XGI330_StandTable is always 0x01 we can
skip or'ing with 0x01 and make the code simpler by removing the if
statements.

Since this function is the only user of the XGI330_StandTable we can
also include the unconditional |= 0x20 into the input data and move the
assignment to SR1 into the loop, which I prefer to start at 0.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe fd1bbbb79e staging/xgifb: Fix return of uninitialized variable
Clang warning:
drivers/staging/xgifb/XGI_main_26.c: warning: variable 'ret' is
used uninitialized whenever 'if' condition:
	if (xgifb_info->mode_idx < 0) {
evaluates to true.

drivers/staging/xgifb/XGI_main_26.c:
note: uninitialized use occurs here
	return ret;

This patch initializes the variable in this case.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe 8cedcc7022 staging/xgifb: mttr must be (signed) int
The mttr field must be declared as signed int (as in every other fb
driver) for the mttr functions to work properly.
Moreover the value should be initialized with -1.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe 44e1312c68 staging/xgifb: Remove always false comparisons
This patch removes some comparisons that always evaluate to false since
xoffset and yoffset are defined as __u32 in fb_var_screeninfo in
include/linux/fb.h and thus can never be negative.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Peter Huewe f2c22605c5 staging/xgifb: Simplify XGI_GetRatePtrCRT2
Since the smaller LCDRefreshIndex is contained identically in LCDARefreshIndex
we can simply use LCDARefreshIndex and skip the if/else.

Since LCDARefreshIndex is only used readonly and contains only small
unsigned values we also change its declaration to const u8.

In order to prevent an out-of-bounds access I changed the mask from 0x0F
to 0x07 and added a dummy value.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-04 10:46:27 -08:00
Minchan Kim 3de738cd30 zram: give up lazy initialization of zram metadata
1) User of zram normally do mkfs.xxx or mkswap before using
   the zram block device(ex, normally, do it at booting time)
   It ends up allocating such metadata of zram before real usage so
   benefit of lazy initialzation would be mitigated.

2) Some user want to use zram when memory pressure is high.(ie, load zram
   dynamically, NOT booting time). It does make sense because people don't
   want to waste memory until memory pressure is high(ie, where zram is really
   helpful time). In this case, lazy initialzation could be failed easily
   because we will use GFP_NOIO instead of GFP_KERNEL for avoiding deadlock.
   So the benefit of lazy initialzation would be mitigated, too.

3) Metadata overhead is not critical and Nitin has a plan to diet it.
   4K : 12 byte(64bit machine) -> 64G : 192M so 0.3% isn't big overhead
   If insane user use such big zram device up to 20, it could consume 6% of ram
   but efficieny of zram will cover the waste.

So this patch gives up lazy initialization and instead we initialize metadata
at disksize setting time.

Acked-by: Jerome Marchand <jmarchand@redhat.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:52:49 -08:00
Minchan Kim 0231c403bb zram: force disksize setting before using zram
Now zram document syas "set disksize is optional"
but partly it's wrong. When you try to use zram firstly after
booting, you must set disksize, otherwise zram can't work because
zram gendisk's size is 0. But once you do it, you can use zram freely
after reset because reset doesn't reset to zero paradoxically.
So in this time, disksize setting is optional.:(
It's inconsitent for user behavior and not straightforward.

This patch forces always setting disksize firstly before using zram.
Yes. It changes current behavior so someone could complain when
he upgrades zram. Apparently it could be a problem if zram is mainline
but it still lives in staging so behavior could be changed for right
way to go. Let them excuse.

Acked-by: Jerome Marchand <jmarchand@redhat.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:52:49 -08:00
Minchan Kim 7e5a5104c6 zram: Fix deadlock bug in partial read/write
Now zram allocates new page with GFP_KERNEL in zram I/O path
if IO is partial. Unfortunately, It may cause deadlock with
reclaim path like below.

write_page from fs
fs_lock
allocation(GFP_KERNEL)
reclaim
pageout
				write_page from fs
				fs_lock <-- deadlock

This patch fixes it by using GFP_NOIO.  In read path, we
reorganize code flow so that kmap_atomic is called after the
GFP_NOIO allocation.

Cc: stable@vger.kernel.org
Acked-by: Jerome Marchand <jmarchand@redhat.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
[ penberg@kernel.org: don't use GFP_ATOMIC ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:52:49 -08:00
H Hartley Sweeten 7f70410fe0 pci_ids.h: add common pci vendor ids from comedi subsystem
There are a number of pci vendor ids that are used in multiple
drivers in the comedi subsystem. Move these ids to pci_ids.h.

This also fixes some build warnings reported by the kbuild test
robot about PCI_VENDOR_ID_AMPLICON being undeclared.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:49:16 -08:00
Ian Abbott 4c4bc25d0f staging: comedi: ni_labpc: correct differential channel sequence for AI commands
Tuomas <tvainikk _at_ gmail _dot_ com> reported problems getting
meaningful output from a Lab-PC+ in differential mode for AI cmds, but
AI insn reads gave correct readings.  He tracked it down to two
problems, one of which is addressed by this patch.

It seems the setting of the channel bits for particular scanning modes
was incorrect for differential mode.  (Only half the number of channels
are available in differential mode; comedi refers to them as channels 0,
1, 2 and 3, but the hardware documentation refers to them as channels 0,
2, 4 and 6.)  In differential mode, the setting of the channel enable
bits in the command1 register should depend on whether the scan enable
bit is set.  Effectively, we need to double the comedi channel number
when the scan enable bit is not set in differential mode.  The scan
enable bit gets set when the AI scan mode is `MODE_MULT_CHAN_UP` or
`MODE_MULT_CHAN_DOWN`, and gets cleared when the AI scan mode is
`MODE_SINGLE_CHAN` or `MODE_SINGLE_CHAN_INTERVAL`.  The existing test
for whether the comedi channel number needs to be doubled in
differential mode is incorrect in `labpc_ai_cmd()`.  This patch corrects
the test.

Thanks to Tuomas for suggesting the fix.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: <stable@vger.kernel.org> # 3.7.x, 3.8.x
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:45:07 -08:00
Ian Abbott 22056e2b46 staging: comedi: ni_labpc: set up command4 register *after* command3
Tuomas <tvainikk _at_ gmail _dot_ com> reported problems getting
meaningful output from a Lab-PC+ in differential mode for AI cmds, but
AI insn reads gave correct readings.  He tracked it down to two
problems, one of which is addressed by this patch.

It seems that writing to the command3 register after writing to the
command4 register in `labpc_ai_cmd()` messes up the differential
reference bit setting in the command4 register.  Set up the command4
register after the command3 register (as in `labpc_ai_rinsn()`) to avoid
the problem.

Thanks to Tuomas for suggesting the fix.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: <stable@vger.kernel.org> # 3.7.x, 3.8.x
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:45:07 -08:00
Ian Abbott de06d7c6b8 staging: comedi: restrict comedi_set_hw_dev() usage
Don't allow comedi drivers to change `dev->hw_dev` using
`comedi_set_hw_dev()` if it's already been set.  Return `-EEXIST` in
that case.

`dev->hw_dev` needs to be set to NULL by the core during clean-up of the
comedi device, so add a local function `comedi_clear_hw_dev()` to do
that.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:44:20 -08:00
Ian Abbott da71751177 staging: comedi: export comedi_set_hw_dev()
Chnage the inline `comedi_set_hw_dev()` to an exported function and
change it's return type from `void` to `int` so we can impose some
restrictions (in a later patch) and return an error if necessary.

Only a few comedi drivers call this, although they don't need to if the
hardware device has been attached automatically via
`comedi_auto_config()` and the comedi driver's `auto_attach()` method.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:44:19 -08:00
Ian Abbott f65cc5447e staging: comedi: change comedi_alloc_subdevice_minor parameters
`comedi_alloc_subdevice_minor()` doesn't really need a parameter
pointing to a `struct comedi_device` as it can get this information from
the parameter pointing to a `struct comedi_subdevice`.  Just pass the
subdevice parameter.

Signed-by: Ian Abbott <abbotti@mev.co.uk>

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:43:28 -08:00
Ian Abbott e9ab1c2f7e staging: comedi: move comedi_alloc_subdevice_minor declarations
Move the declarations of `comedi_alloc_subdevice_minor()` and
`comedi_free_subdevice_minor()` from "comedidev.h" to
"comedi_internal.h" since they are only of interest to the comedi core,
and are not exported to the low-level comedi drivers.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:43:27 -08:00
Garrick He eec0d0dc4e Staging: wlan-ng: Fix tab coding style issue in hfa384x.h
Fix all 'please, no space before tabs' warning found by checkpatch.pl

Signed-off-by: Garrick He <garrickhe@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:42:07 -08:00
H Hartley Sweeten f91f9beaa1 staging: comedi: das08: split out bus specific code
Split the bus specific ISA/PC-104 and PCI code out of this driver
and create two new drivers, das08_isa and das08_pci.

This allows removing all the #ifdef'ery in the das08 driver that
handled if the CONFIG_COMEDI_DAS08_{ISA,PCI} options were enabled.

It also makes the PCI driver cleanly Plug-and-Play since the comedi
driver only has an auto_attach callback. Previously it also had an
attach callback in order to handle the ISA cards.

Since the PCMCIA support was already split out, we can also remove
the now unused enum das08_bustype and it's use in the boardinfo.
The bus specific code deals with the bustype automatically before
it calls the common attach function in das08.

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-02-03 17:33:08 -08:00
Andres More ec6e0f63d6 staging: vt6656: fix C99 // comments in main_usb.c
Resolved 'do not use C99 // comments' checkpatch errors.
Many warnings about odd indentation were left.

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:32:26 -08:00
Andres More d3e2395154 staging: vt6656: fixed C99 // comments in two headers
Cleared 'do not use C99 // comments' checkpatch error in device.h and
device_cfg.h

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:32:26 -08:00
Andres More 84cf5fcbb5 staging: vt6656: cleared C99 // comments in datarate.c
Cleared 'do not use C99 // comments' checkpatch error, several warnings
about code indentation and camel casing were not resolved.

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:32:26 -08:00
Andres More c16fdffc2d staging: vt6656: fixed C99 // comments
Cleared 'do not use C99 // comments' checkpatch errors in two headers.
Several obvious comments were removed.

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:32:26 -08:00
Andres More 74ecdc5e4b staging: vt6656: cleared 'do not use C99 // comments' checkpatch errors
Switched // comments into respective /**/ ones

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:30:41 -08:00
Andres More 77970254b0 staging: vt6656: cleared 'do not use C99 // comments' checkpatch errors
switched all // comments on file to respective /**/

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 17:30:41 -08:00
H Hartley Sweeten 42d1aeea84 staging: comedi: ni_mio_cs: convert to auto attach
Convert this pcmcia driver to the comedi auto attach mechanism.

This allows getting rid of the "hack" needed to pass the pcmcia_device
pointer from the pcmcia_driver to the comedi_driver.

We still need the boardinfo because ni_mio_common.c uses it. Cleanup
ni_getboardtype() so it returns a pointer to the boardinto instead
of the index.

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-02-03 17:29:47 -08:00
H Hartley Sweeten 42e4472ef1 staging: comedi: ni_labpc_cs: convert to auto attach
Convert this pcmcia driver to the comedi auto attach mechanism.

This allows getting rid of the "hack" needed to pass the pcmcia_device
pointer from the pcmcia_driver to the comedi_driver.

We still need the boardinfo because the ni_labpc driver uses it. But
we can get rid of the duplicate that allowed attaching with the driver
name.

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-02-03 17:29:47 -08:00
H Hartley Sweeten 89d714ce63 staging: comedi: ni_daq_dio24: remove some unnecessary includes
This driver does not use anything from the interrupt.h, slab.h,
and ioport.h headers. Don't bother including them.

For aesthetic reasons, move the include of the comedi specific
8255.h header to the end of the includes.

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-02-03 19:27:38 -06:00
H Hartley Sweeten 5a1daad46a staging: comedi: ni_daq_dio24: convert to auto attach
Convert this pcmcia driver to the comedi auto attach mechanism.

This allows getting rid of the "hack" needed to pass the pcmcia_device
pointer from the pcmcia_driver to the comedi_driver as well as the
now unnecessary boardinfo.

Check the call to subdev_8255_init() for success. That function does
a kzalloc and could return -ENOMEM.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 19:27:37 -06:00
H Hartley Sweeten 6746dc6340 staging: comedi: ni_daq_dio24: cleanup dio24_detach
Simplify the call to subdev_8255_cleanup() to remove the
need for a local variable.

This driver only attaches to pcmcia devices so the test for
thisboard != pcmcia_bustype will always fail. Remove the test
and the unreachable release_region().

This driver also never does a request_irq() so remove the
free_irq().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-03 19:27:37 -06:00
H Hartley Sweeten 5316ec5453 staging: comedi: ni_daq_dio24: remove '#undef LABPC_DEBUG'
The LABPC_DEBUG define is not used in this driver. Just remove the

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-02-03 19:27:37 -06:00
H Hartley Sweeten 61f828ec59 staging: comedi: ni_daq_dio24: remove comedi private data
The comedi private data, struct dio24_private, is not used in
the driver. Remove it and the kzalloc.

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-02-03 19:27:37 -06:00
H Hartley Sweeten 41722460b7 staging: comedi: ni_daq_dio24: remove the '#ifdef incomplete' code
All the '#ifdef incomplete' code deals with interrupt support in
this driver. For now just remove all this #if'defed out code.

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-02-03 19:27:37 -06:00
H Hartley Sweeten fb89942cb3 staging: comedi: ni_daq_dio24: remove thisboard macro
The 'thisboard' macro relies on a local variable having a specific
name and yields a pointer derived from that local variable.

Replace the macro with a local variable and use the comedi_board()
helper to get the 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-02-03 19:27:37 -06:00
H Hartley Sweeten 25602bd735 staging: comedi: ni_daq_dio24: move comedi_driver declaration
Move the comedi_driver declaration down in the file. This removes
the need for the forward declarations.

For aesthetic reasons, add some whitespace to the declaration.

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-02-03 19:27:37 -06:00