Ben Chan [Wed, 12 Sep 2012 18:43:41 +0000 (11:43 -0700)]
staging: gdm72xx: simplify alloc_tx_struct and alloc_rx_struct
This patch simplifies alloc_tx_struct and alloc_rx_struct in gdm_sdio.c
and gdm_usb.c by replacing kmalloc+memset with kzalloc and reorganizing
the code.
Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: ipack/devices/ipoctal: Clean up device removal.
Make use of dev_set_drvdata() and dev_get_drvdata() to store and obtain
a pointer to the ipoctal struct corresponding to a struct dev.
Previously we relied on a private list of devices.
Rename __tpci_request_irq() to tpci_enable_irq() and __tpci_free_irq()
to tpci_disable_irq(). Change their second argument, move them above
tpci200_interrupt(), and use tpci_disable_irq() in the latter
Staging: ipack/bridges/tpci200: Clean up interrupt handling.
Previously the return value from tpci200_interrupt was not quite correct
if a slot had caused an interrupt but no handler was instellalled:
IRQ_NONE was returned. However in this case we react to the interrupt
by disabling the IPack device interrupt.
Basically there are two cases the code now distinguishes:
- The tpci200 has raised an interrupt. We handle it and return
IRQ_HANDLED.
- Our device did not raise an interrupt. We return IRQ_NONE.
Staging: ipack/bridges/tpci200: Protect device registers with spinlock.
Some of the device registers are accessed from both interrupt and
non-interrupt context. To ensure proper read-modify-write modification
of these registers we can not use the "global" tpci200 mutex. Instead
a spin-lock is used.
In tpci200_request_irq as well as tpci200_free_irq we set and unset the
pointer to struct slot_irq. This pointer is accessed in
tpci200_interrupt. To ensure that the pointer is not freed after it has
been fetched in tpci200_interrupt() it is now protected through RCU.
Staging: ipack/devices/ipoctal: put ipoctal_channel into tty->driver_data.
Each tty's driver_data is now pointing to the channel it is talking to. struct
ipoctal_channel contains all the information the callbacks require to do their
work.
Staging: ipack/devices/ipoctal: split ipoctal_channel from ipoctal.
By moving everything channel related into a separate struct we will be
able to clean up a lot of code. In the end tty->driver_data will no
longer need to point to ipoctal but instead can point to the respective
channel.
Macpaul Lin [Wed, 12 Sep 2012 09:49:24 +0000 (17:49 +0800)]
staging/gdm72xx: gdm_usb coding style clean up
gdm_usb.* coding style clean up.
Signed-off-by: Macpaul Lin <macpaul@gmail.com> Cc: Paul Stewart <pstew@chromium.org> Cc: Ben Chan <benchan@chromium.org> Cc: Sage Ahn <syahn@gctsemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@unchanged exists@
position r.p1,r.p2;
expression e <= r.x,x,e1;
iterator I;
statement S;
@@
if (x@p1 == NULL) { ... when != I(x,...) S
when != e = e1
when != e += e1
when != e -= e1
when != ++e
when != --e
when != e++
when != e--
when != &e
kfree@p2(x); ... return ...; }
@ok depends on unchanged exists@
position any r.p1;
position r.p2;
expression x;
@@
... when != true x@p1 == NULL
kfree@p2(x);
@depends on !ok && unchanged@
position r.p2;
expression x;
@@
*kfree@p2(x);
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@unchanged exists@
position r.p1,r.p2;
expression e <= r.x,x,e1;
iterator I;
statement S;
@@
if (x@p1 == NULL) { ... when != I(x,...) S
when != e = e1
when != e += e1
when != e -= e1
when != ++e
when != --e
when != e++
when != e--
when != &e
kfree@p2(x); ... return ...; }
@ok depends on unchanged exists@
position any r.p1;
position r.p2;
expression x;
@@
... when != true x@p1 == NULL
kfree@p2(x);
@depends on !ok && unchanged@
position r.p2;
expression x;
@@
*kfree@p2(x);
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kevin McKinney [Wed, 12 Sep 2012 02:19:06 +0000 (22:19 -0400)]
Staging: bcm: Create and initialize new device id in InterfaceInit
This patch create and initalizes a new device
id of 0x172 as reported by Rinat Camalov
<richman1000000d@gmail.com>. In addition, a
comment is added to the potential invalid
existing device id.
The legacy attach used the "dummy" boardinfo entry to allow
matching a boardinfo to a pci card based on the "name" passed
by the comedi core. This driver now uses the PCI auto config
mechanism which always matches to the PCI vendor/device ids.
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>
The 'valid' variable in the private data is only used in the
detach of the board to determine if the pci1710_reset() function
can be called. That function only requires a valid dev->iobase
to work. Use that for the check instead and remove the unneeded
variable 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>
staging: comedi: adv_pci1710: use attach_pci callback
Convert this PCI driver to use the comedi PCI auto config attach
mechanism by adding an 'attach_pci' callback function. Since the
driver does not require any external configuration options, and
the legacy 'attach' callback is now optional, 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>
staging: comedi: icp_multi: use attach_pci callback
Convert this PCI driver to use the comedi PCI auto config attach
mechanism by adding an 'attach_pci' callback function. Since the
driver does not require any external configuration options, and
the legacy 'attach' callback is now optional, remove it. The
boardinfo is also not needed now so remove it also.
This also allows removing the icp_multi.h header completely.
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>
staging: comedi: icp_multi: remove rangecode from boardinfo
The analog inputs and outputs for this driver use the same table
to set the analog range. Remove the boardinfo for it and just
reference the table directly.
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>
staging: comedi: icp_multi: remove n_aichan from boardinfo
There is only one board type supported by this driver and the
number of analog input channels is constant. Remove the
boardinfo for it and just open-code the value.
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>
staging: comedi: icp_multi: remove n_aochan from boardinfo
There is only one board type supported by this driver and the
number of analog output channels is constant. Remove the
boardinfo for it and just open-code the value.
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>
staging: comedi: icp_multi: remove n_dichan from boardinfo
There is only one board type supported by this driver and the
number of digital input channels is constant. Remove the
boardinfo for it and just open-code the value.
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>
staging: comedi: icp_multi: remove n_dochan from boardinfo
There is only one board type supported by this driver and the
number of digital output channels is constant. Remove the
boardinfo for it and just open-code the value.
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>
staging: comedi: icp_multi: remove n_ctrs from boardinfo
There is only one board type supported by this driver and the
number of counter channels is constant. Remove the boardinfo
for it and just open-code the value.
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>
staging: comedi: icp_multi: convert to a pci_driver
This driver is for a PCI device not a legacy device.
Convert it from a module_comedi_driver to a module_comedi_pci_driver.
This will allow using the comedi_pci_auto_config mechanism to attach
to the 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>
The ipoctal devices can be uninstalled from the ipack_driver_unregister()
call as the device model calles the bus's .remove() function for each device
registered by the driver and it will execute the .remove() function of the
ipoctal driver.
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: ipack/bridges/tpci200: fix the uninstall the ipack device
Using the call to the ipack_device_unregister() function to avoid the
strange way it was doing, as the device model will take care of calling
the bus's .remove function when a device is being unregistered.
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
We check the CRC and store the result of the check in struct ipac_device.
A warning is emitted if the check fails. However we leave it to the
IPack module device to refuse to initialize due to a bad CRC. I have seen
otherwise good modules with bad CRCs.
Staging: ipack: reset previous timeouts during device registration.
Resetting the previous timeout we avoid to read the timeout status register
and see timeout errors that don't correspond to the present state of the
device.
staging: omap-thermal: improve conf data handling and initialization
While registering the thermal zone, it is required to have the cooling
devices already setup, so that the .bind callback can succeed.
Due to that, the driver code needs to be reorganized so that we first
setup the cooling devices then the zones. This way we cope with the
right thermal framework initialization sequence.
This patch changes the order of the thermal zone initialization,
so that we create it only when the cooling devices are available.
It also adds some defensive checks for the config data, so that
the callbacks are ready for calls when the data is still not
initialized.