Marek Vasut [Sat, 29 Jun 2013 21:20:00 +0000 (22:20 +0100)]
iio: mxs-lradc: Fix misuse of iio->trig
The struct iio_dev .trig field is to be used only by the IIO core,
the driver shall not fill this field. This fixes ugly crash when
the driver is compiled as a module and the module is rmmod'd.
Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
When reading IIO_CHAN_INFO_OFFSET, the return value of iio_channel_read() for
success will be IIO_VAL*, checking for 0 is not correct.
Without this fix the offset applied by iio drivers will be ignored when
converting a raw value to one in appropriate base units (e.g mV) in
a IIO client drivers that use iio_convert_raw_to_processed including
iio-hwmon.
Since the info_mask split, iio_channel_has_info() is not working correctly.
info_mask_separate and info_mask_shared_by_type, it is not possible to compare
them directly with the iio_chan_info_enum enum. Correct that bit using the BIT()
macro.
Jonathan Cameron [Sat, 22 Jun 2013 11:00:04 +0000 (12:00 +0100)]
iio:trigger: device_unregister->device_del to avoid double free
iio_trigger unregistration and freeing has been separated in this
code for some time, but it looks like the calls to the device
handling were not appropriately updated.
Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reported-by: Otavio Salvador <otavio@ossystems.com.br> Tested-by: Otavio Salvador <otavio@ossystems.com.br> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Xenia Ragiadakou [Mon, 24 Jun 2013 23:28:59 +0000 (02:28 +0300)]
staging: rtl8192u: fix comments in r819xU_phy.h
This patch fixes the comments by:
- changing them to follow the kernel coding style
- removing commented-out code
- removing comments that refer developer's name
Xenia Ragiadakou [Mon, 24 Jun 2013 23:28:57 +0000 (02:28 +0300)]
staging: rtl8192u: fix newlines in r819xU_phy.c
This patch fixes the newlines by:
- adding a newline after variables declarations.
- removing the newlines following the return statement.
- removing the newlines between function header comments
and function definitions.
- adding one newline between function definitions.
- adding a newline at the end of RT_TRACE messages.
This was done to improve code's and logmessages'
readability.
staging: comedi: unioxx5: use comedi_alloc_spriv()
Use the helper function to allocate the memory and set the subdevice
private pointer. This allows the core to automatically free the
memory during the detach so the driver doesn't need to deal with 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>
During the attach of this driver, it's possible for the allocation
of the subdevice private data to fail. It's also possible that the
io region was not successfully requested.
Validate the pointer and iobase before trying to release the region.
For aesthetic reasons, rename the local variables.
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>
Chad Williamson [Sun, 23 Jun 2013 07:02:26 +0000 (02:02 -0500)]
Staging: silicom: remove the board_t typedef in bpctl_mod.c
Replace the board_t enum typdef with struct board_type (_type for
consistency with media_type, above), resolving a checkpatch.pl
warning. (As far as I can tell, this isn't used anywhere.)
Signed-off-by: Chad Williamson <chad@dahc.us> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Xenia Ragiadakou [Sun, 23 Jun 2013 03:15:18 +0000 (06:15 +0300)]
staging: rtl8192u: replace msleep(1) with usleep_range() in r819xU_phy.c
This patch fixes the following checkpatch warning:
WARNING: msleep < 20ms can sleep for up to 20ms
The implementation of msleep() is based on jiffies timeout
subsystem. Hence, its resolution is constrained by the value
of HZ tick rate. When HZ variable is configured to 100,
the jiffies variable is updated every 10 ms, so a timeout
of 1ms cannot be met using jiffies (it will be rounded up
to 10ms).
This patch replaces msleep(1) with usleep_range(1000, 1000).
usleep_range() uses hrtimers subsystem which is not bound
to HZ value and can provide microsecond-level resolution.
Xenia Ragiadakou [Sun, 23 Jun 2013 03:15:17 +0000 (06:15 +0300)]
staging: rtl8192u: rename dwRegRead and rtStatus in r819xU_phy.c
This patch renames the following variables:
'dwRegRead' into 'reg'
'rtStatus' into 'status'
This is done primarily to reduce line length below 80 chars,
since the size and the usage of dwRegRead variable
can be deduced by its type and the function called
to assign it, so it can be replaced by simply 'reg'.
Also, rtStatus is not more informative than just status
in the given context.
Xenia Ragiadakou [Sun, 23 Jun 2013 03:15:15 +0000 (06:15 +0300)]
staging: rtl8192u: limit line size in r819xU_phy.c
This patch limits the line size below 80 characters,
when possible without producing new checkpatch errors.
This is done by adjusting identation, replacing hardcoded
function names in messages with __func__, merging some
trailing comments with the header comments when they both
refer to the same line and removing some unnecessary
parenthesis.
Also, changes slightly some RT_TRACE messages to make
them shorter without altering their content.
Philipp Zabel [Fri, 21 Jun 2013 12:52:17 +0000 (14:52 +0200)]
staging: drm/imx: use generic irqchip
This depends on the patch "genirq: Generic chip: Add linear irq domain support"
and removes the custom IPU irq_chip and irq_domain_ops. Instead, the generic
irq chip implementation is reused.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Zabel [Fri, 21 Jun 2013 08:57:20 +0000 (10:57 +0200)]
staging: drm/imx: ipuv3-crtc: immediately update crtc->fb in ipu_page_flip
Since commit 8cf1e9811471f2910fa38dc1b28e1789080ba961
("drm: Add consistency check for page-flipping") drm_mode_page_flip_ioctl
contains a WARN_ON that triggers if the .page_flip callback didn't update
the crtc->fb pointer to the new framebuffer immediately.
The IPU can request up to four pixels per access, which gives four
times the bandwidth compared to what the driver currently assumes.
After correcting this, we have to increase safety margins for
bandwidth requirement calculations.
Philipp Zabel [Fri, 21 Jun 2013 08:27:39 +0000 (10:27 +0200)]
staging: drm/imx: convert IPU irq driver to irq_domain_add_linear
The IPU has a lot of interrupts. Instead of allocating descs for all
of them, register a linear irq domain and create mappings as needed.
This was listed in the TODO as a prerequisite to move the IPU driver
out of staging.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Move zram sysfs code to zram drv and remove zram_sysfs.c
file. This gives ability to make static a number of previously
exported zram functions, used from zram sysfs, e.g. internal zram
zram_meta_alloc/free(). We also can drop zram_drv wrapper
functions, used from zram sysfs:
e.g. zram_reset_device()/__zram_reset_device() pair.
v2: as suggested by Greg K-H, move MODULE description to the
bottom of the file.
Marc Dietrich [Fri, 21 Jun 2013 08:28:55 +0000 (10:28 +0200)]
staging: nvec: move device tree parsing to its own function
This moves device tree parsing to its own function so more stuff can
be cleanly added in the future.
Signed-off-by: Leon Romanovsky <leon@leon.nu> Signed-off-by: Marc Dietrich <marvin24@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Marc Dietrich [Fri, 21 Jun 2013 08:28:54 +0000 (10:28 +0200)]
staging: nvec: remove instantiating via platform device
Tegra has been converted to support device tree only. Remove support
for instantiating via platform device.
Signed-off-by: Leon Romanovsky <leon@leon.nu> Signed-off-by: Marc Dietrich <marvin24@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Mon, 24 Jun 2013 16:12:09 +0000 (19:12 +0300)]
staging: vt6655: info leak in ioctl
The SCmdLinkStatus struct has a couple holes. There is one between
->bLink and ->wBSSType, and another between ->abySSID and ->uChannel.
I've added a memset() to initialize the struct to zero. Since we don't
need to clear abySSID any more so I've removed that memset. It was
wrong anyway: abySSID has "SSID_MAXLEN + 2" (34) bytes, not
"WLAN_SSID_MAXLEN + 1" (33).
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Zimmerman [Mon, 24 Jun 2013 18:34:23 +0000 (11:34 -0700)]
staging: dwc2: fix thinko in dwc2_hc_set_even_odd_frame()
I screwed up the sense of this if() statement while porting our
vendor driver to create the dwc2 driver. This caused frame overrun
errors on periodic transfers when there were other transfers
active in the same (micro)frame.
With this fix, the dwc2 driver now works on the Raspberry Pi
platform even with the USB Ethernet controller enabled, where
before that would cause all USB devices to stop working.
Thanks to Ray Jui and Jerry Lin at Broadcom for tracking this down.
Reported-by: Ray Jui <rjui@broadcom.com> Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Arnd Bergmann [Fri, 21 Jun 2013 19:55:35 +0000 (21:55 +0200)]
staging: line6: avoid __sync_fetch_and_{and,or}
__sync_fetch_and_and and __sync_fetch_and_or are functions that are provided
by gcc and depending on the target architecture may be implemented in libgcc,
which is not always available in the kernel. This leads to a build failure
on ARMv5:
drivers/built-in.o: In function `line6_pcm_release':
:(.text+0x3bfe80): undefined reference to `__sync_fetch_and_and_4'
drivers/built-in.o: In function `line6_pcm_acquire':
:(.text+0x3bff30): undefined reference to `__sync_fetch_and_or_4'
To work around this, we can use the kernel-provided cmpxchg macro.
Build-tested only.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Markus Grabner <grabner@icg.tugraz.at> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: pcmuio: cleanup DIO subdevice (*insn_{bits,config})
Use the pcmuio_{read,write}() helpers to read/write all 24 channels
instead of handling the digital I/O as three separate ports. This
simplifies both functions with minimal overhead.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: pcmuio: remove 'iobases' from subdevice private data
The 'asic' and 'port' associated with a given subdevice can easily be
found based on the subdevice 'index'. With that information we can
then calculate the correct iobase and register offset needed to read/
write the 8-bit ports.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: pcmuio: simplify 'n_subdevs' and 's->n_chan'
The number of subdevices needed by the driver is based on the
'num_asics' reported by the boardinfo and each subdevice always
has 24 channels. Simplify the attach a bit.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This member of the subdevice private data is always initialize to
'0' due to the 'thisasic_chanct' always being zero when it is set
during the attach. Simplify the driver a bit by removing it.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This member of the subdevice private data is always initialize to
s->n_chan if the subdevice supports interrupts and is only used
in functions that can be called by the interrupt subdevice.
Simplyfy the driver a bit by removing it and just using s->n_chan.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This member of the subdevice private data is always initialize to
'0' due to the 'byte_no' always being zero when it is set during
the attach. Simplify the driver a bit by removing it.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
All the I/O ports are left unlocked in the driver so the 'pagelock'
in the private data is not necessary. The paranoia sanity checks
are also unnecessary, Remove them.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: have comedi_set_spriv() allocate the memory
As suggested by Ian Abbott, comedi_set_spriv() can only be used to
set the subdevice->private pointer to something that can be kfree()'d.
Rename the function to comedi_alloc_spriv() and have it kzalloc() the
memory as well as set the private pointer. This saves a function call
in the drivers and avoids the possibility of incorrectly calling
comedi_set_spriv() for some pointer that is not meant to be kfree()'d.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
None of the addi-data drivers that still use the "common" code have
ttl digital i/o. Remove the unnecessary boardinfo as well as the
subdevice initialization code.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi-data: remove unused vars from boardinfo
Due to the on-going cleanup of the addi-data drivers, the boardinfo
used in the "common" code has a number of variables that are not
used. Remove the cruft.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi-data: simplify the PCI bar reading
All of the remaining addi-data drivers that use the "common" code
either do not have an eeprom or the PCI controller chip is not a
PLX PCI 9054. Knowing this we can simplify the common code that
reads the PCI bars to get the iobase addresses.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi-data: remove unused vars from private data
Due to the on-going cleanup of the addi-data drivers, the private
data used in the "common" code has a number of variables that
either are not used at all or or set but never used.
Remove all of them from the private data and the unnecessary use
in the drivers.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Xenia Ragiadakou [Wed, 19 Jun 2013 01:58:07 +0000 (04:58 +0300)]
staging: rtl8192u: fix comments in r819xU_phy.c
This patch fixes the comments in r819xU_phy.c by:
- replacing "// ..." with "/* .... */"
- removing unnecessary comments, the dates and names of
developers from comments
- fixing some inconsistent comments
- fixing some typos
- fixing alignment issues
Xenia Ragiadakou [Wed, 19 Jun 2013 01:58:05 +0000 (04:58 +0300)]
staging: rtl8192u: remove variable 'Ret' in r819xU_phy.c
This patch removes variable 'Ret' from rtl8192_QueryBBReg()
since its value is returned immediately after it is
assigned. The name 'Ret', anyway, does not give any
insight and the function description comment is sufficiently
informative regarding the returned value.
Chad Williamson [Tue, 18 Jun 2013 03:32:05 +0000 (22:32 -0500)]
Staging: silicom: move more assignments out of if conditions
Remove more assignments from if-statement conditions in bpctl_mod.c,
resolving checkpatch.pl errors. Those that remain need more attention
than I'm presently prepared to give them.
Signed-off-by: Chad Williamson <chad@dahc.us> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chad Williamson [Tue, 18 Jun 2013 03:32:04 +0000 (22:32 -0500)]
Staging: silicom: move assignments out of if conditions
Remove a bunch of assignments from if-statement conditions in
bpctl_mod.c, resolving checkpatch.pl errors. (This isn't all of
them, but the patch is getting rather long...)
Signed-off-by: Chad Williamson <chad@dahc.us> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Xenia Ragiadakou [Tue, 18 Jun 2013 02:29:41 +0000 (05:29 +0300)]
staging: rtl8192u: rename general variables in r819xU_phy.c
This patch renames the following variables:
- dwRegAddr and RegAddr into reg_addr
- dwData and Data into data
- BitShift into bitshift
- Offset into offset
- NewOffset into new_offset
- Bandwidth into bandwidth
The renaming was done to remove camel case and
unnecessary 'dw' prefix from the above variable names.
Xenia Ragiadakou [Tue, 18 Jun 2013 02:29:40 +0000 (05:29 +0300)]
staging: rtl8192u: rename *BitMask variables in r819xU_phy.c
This patch renames BitMask and dwBitMask variables into
bitmask to remove camel case.
dwBitMask in the given context can be renamed into simply
bitmask since its number of bits (dw->32) can be deduced
by its type which is u32.
Xenia Ragiadakou [Tue, 18 Jun 2013 02:29:39 +0000 (05:29 +0300)]
staging: rtl8192u: replace *Value variables in r819xU_phy.c
This patch renames the variables OriginalValue, NewValue,
Original_Value, New_Value and retValue to reg, and
the variables bRegValue and dwRegValue to reg_u8 and
reg_u32, respectively. This is done primarily in
order to reduce the variable name length and consequently
line length.
Also, it replaces the pair of Original and New variables
with one variable.
Markus Niebel [Tue, 18 Jun 2013 01:23:58 +0000 (09:23 +0800)]
staging: imx_drm: imx_ldb: fix 18 bit format
Since 18 bit is supported as datawidth in device tree it should be
supported in driver. Beside the LDB channel the IPU channel has also
to be configured to use BGR666.
Xenia Ragiadakou [Sat, 15 Jun 2013 04:29:02 +0000 (07:29 +0300)]
staging: rtl8192u: fix braces in r819xU_phy.c
This patch fixes the brace position and the whitespace
around braces.
That corrects the following checkpatch errors:
ERROR: that open brace { should be on the previous line
ERROR: else should follow close brace '}'
ERROR: space required after that close brace '}'
Also, it removes completely an if(0) statement,
instead of correcting its braces.