There are a few fixes in here that might, earlier in a cycle, have gone
to Greg as fixes. Given they are either minor or have never actually
been observed as causing trouble (the locking bug in the event code) and
are invasive, I have included them in this pull request, targeting the
3.15 merge window instead.
The rest are pretty uncontroversial new drivers, a handy little tool for
the example code in our documentation and little cleanups.
New drivers
* Freescale Vybrid and i.MX6SLX ADC driver.
* HID Sensor hub proximity sensors.
* HID Sensor hub pressure sensors.
* LPS25H Pressure sensors added to the ST micro pressure sensor driver.
New functionality
* lsiio tool. This is added to the staging tree as we haven't yet moved
the example code it sits with out. Moving this code out is now a reasonably
high priority but holding up this tool in the meantime did not seem
worthwhile.
* mag3110 - add missing scale factor for temperature output to userspace.
Cleanups
* Fix a bug in the event reporting in which a spin lock might be held over
when a sleep occured. A similar bug was found by Lars in the buffer code.
It has not to our knowledge been observed as actually occuring and is
a little too invasive to push out as a fix.
* Drop the IIO_ST macro after clearing out all users. This macro was a very
bad idea leading to a number of bugs after it stopped covering all elements
of the structure being assigned and people started making assumptions about
what it did cover. Glad to see it go!
* Avoid applying extended name to shared attributes as it makes no sense.
No in tree drivers were using the combination, hence not pushed out as
a fix.
* ad799x - move to devm_request_threaded_irq to reduce boilerplate clean up.
* bma180 - make the low_pass_filter_3db_frequency info element shared rather
than per attribute. The old approach was valid but not as clean as it might
be and was setting a bad example. Hence the cleanup.
* mxs-lradc - propogate the error code form a platform_get_irq call rather than
eating it up by returning -EINVAL on all errors.
* ad799x - typo fix in the copyright message. Either that or Michael was
asserting a copyright that moved backwards in time by about a thousand years.
* ad799x - use a regulator for vref rather than platform data. The driver
dates from just as the regulator framework was coming into common use so
provides an alternative way of specifying the reference voltage. We no
longer need that approach so drop it in favour of a regulator only approach.
* max1363 - some internal vref values were out by a small amount. The effect
would have been tiny and no one noticed hence not pushing this through as
a fix.
* core - replace some pointless goto error_ret (with no clean up) lines with
direct returns. This is my bad coding style so I'm glad to see it cleaned
up.
* core - avoid a kasprintf that just directly prints a string with no
formatting elements. This has always been there but Lars just noticed it.
Oops.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAABAgAGBQJTCht4AAoJEFSFNJnE9BaIsssQALHkJOTts8eAMy+N8JQkUcWE
JhDEbu689OoR9NtVc2o/4nfFaVwzWk6MBtLY1wxpsNFi4IxL/utVBv4iP4pPCBZ1
g3VFiHgREPOxgup8MDXhmwx+n0tRyLJd+vX6uBFDMF/+MNqXMUy/38eWZCYMXz87
icdxk9Ircr+ud7q0JVcpeNGjMUNHo+yEORFSKbdnTfKCuRJe7xdSqNpRQBQEr6y9
ohRJ6CXf9FNsoDuInk3VNEo6HtbZmVi215fy8nGknP5t6/q6exl0utPihoNpWJNZ
aP1qjUrS1XEAIozQAoJi9Q2hJSxIRNXwuVz1modcPEeattKGajGWJggHZJxk27Sf
fiSeRbbw1vJ8hLN7mRcg1FIF2m79cA7pkhUWwKO2m7Dp/sJQ/eKnhh/JJML6sZB5
3/zKFlvpgANfSZTmqDGCQ/hVBNUcJ7xJA1Vbh1t2FIYctZlkh9ogfX/T2wHEJTfg
Mpg7BoDgOaicUyiZBFADsHxTDuhlhx6en9JfYqR6YZHd1eMU7SR1IHzGpo4mDxkB
fUUmu0bWnEwslmzek7CaGMVZ00WcSlsP6mpQzfk/R98bIZJb1MmKWyuefVMKyr4K
JxNbPIBwR70A6j8qh/lh3egQsUpuamsXoO7Y68RxylYOf1XL7zYWo/1xoOh4Jl4Q
+gihFn6B6ggHjv1wup2G
=Dg3R
-----END PGP SIGNATURE-----
Merge tag 'iio-for-3.15b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second round of IIO new driver, functionality and cleanups for the 3.15 series.
There are a few fixes in here that might, earlier in a cycle, have gone
to Greg as fixes. Given they are either minor or have never actually
been observed as causing trouble (the locking bug in the event code) and
are invasive, I have included them in this pull request, targeting the
3.15 merge window instead.
The rest are pretty uncontroversial new drivers, a handy little tool for
the example code in our documentation and little cleanups.
New drivers
* Freescale Vybrid and i.MX6SLX ADC driver.
* HID Sensor hub proximity sensors.
* HID Sensor hub pressure sensors.
* LPS25H Pressure sensors added to the ST micro pressure sensor driver.
New functionality
* lsiio tool. This is added to the staging tree as we haven't yet moved
the example code it sits with out. Moving this code out is now a reasonably
high priority but holding up this tool in the meantime did not seem
worthwhile.
* mag3110 - add missing scale factor for temperature output to userspace.
Cleanups
* Fix a bug in the event reporting in which a spin lock might be held over
when a sleep occured. A similar bug was found by Lars in the buffer code.
It has not to our knowledge been observed as actually occuring and is
a little too invasive to push out as a fix.
* Drop the IIO_ST macro after clearing out all users. This macro was a very
bad idea leading to a number of bugs after it stopped covering all elements
of the structure being assigned and people started making assumptions about
what it did cover. Glad to see it go!
* Avoid applying extended name to shared attributes as it makes no sense.
No in tree drivers were using the combination, hence not pushed out as
a fix.
* ad799x - move to devm_request_threaded_irq to reduce boilerplate clean up.
* bma180 - make the low_pass_filter_3db_frequency info element shared rather
than per attribute. The old approach was valid but not as clean as it might
be and was setting a bad example. Hence the cleanup.
* mxs-lradc - propogate the error code form a platform_get_irq call rather than
eating it up by returning -EINVAL on all errors.
* ad799x - typo fix in the copyright message. Either that or Michael was
asserting a copyright that moved backwards in time by about a thousand years.
* ad799x - use a regulator for vref rather than platform data. The driver
dates from just as the regulator framework was coming into common use so
provides an alternative way of specifying the reference voltage. We no
longer need that approach so drop it in favour of a regulator only approach.
* max1363 - some internal vref values were out by a small amount. The effect
would have been tiny and no one noticed hence not pushing this through as
a fix.
* core - replace some pointless goto error_ret (with no clean up) lines with
direct returns. This is my bad coding style so I'm glad to see it cleaned
up.
* core - avoid a kasprintf that just directly prints a string with no
formatting elements. This has always been there but Lars just noticed it.
Oops.
The event code currently holds a spinlock with IRQs disabled while calling
kfifo_to_user(). kfifo_to_user() can generate a page fault though, which means
we have to be able to sleep, which is not possible if the interrupts are
disabled. The good thing is that kfifo handles concurrent read and write access
just fine as long as there is only one reader and one writer, so we do not any
locking to protect against concurrent access from the read and writer thread. It
is possible though that userspace is trying to read from the event FIFO from
multiple concurrent threads, so we need to add locking to protect against this.
This is done using a mutex. The mutex will only protect the kfifo_to_user()
call, it will not protect the waitqueue. This means that multiple threads can be
waiting for new data and once a new event is added to the FIFO all waiting
threads will be woken up. If one of those threads is unable to read any data
(because another thread already read all the data) it will go back to sleep. The
only remaining issue is that now that the clearing of the BUSY flag and the
emptying of the FIFO does no longer happen in one atomic step it is possible
that a event is added to the FIFO after it has been emptied and this sample will
be visible the next time a new event file descriptor is created. To avoid this
rather move the emptying of the FIFO from iio_event_chrdev_release to
iio_event_getfd().
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds support for the new barometer sensor: LPS25H.
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Added usage id processing for Pressure Sensor. This uses IIO
interfaces for triggered buffer to present data to user
mode. This uses HID sensor framework for registering callback
events from the sensor hub.
Signed-off-by: Archana Patni <archana.patni@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Added usage id processing for Proximity (Human Presence).
This uses IIO interfaces for triggered buffer to present data
to user mode. This uses HID sensor framework for registering
callback events from the sensor hub.
Signed-off-by: Archana Patni <archana.patni@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This function probes a number of the boards registers during the
(*attach) to verify that it is actually a PCL-816 compatible board.
For aesthetics, move the function closer to the (*attach).
To better match the pcl818 driver, allocate the private data before
calling pcl816_check().
Refactor the function to return an errno if fails. Change the errno
from -EIO to -ENODEV and remove the unnecessary dev_err() noise.
Make sure the CONTROL register is reset to a known state after the
check. The 0x18 value actually defines an invalid interrupt selection
and sets an undefined bit.
Add a couple comments to clarify the magic values.
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>
These comments are just added cruft. 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>
If the dev->irq is not valid the interrupt function will not be hooked
up during the attach. Remove the unnecessary check.
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 in the private data is a flag that indicates that an analog
input async command is currently running. Rename it to make this clear.
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>
The private data is kzalloc'ed in the (*attach). There is no need to
initialize any of the members to 0.
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>
The 'irq_was_now_closed' member is actually a flag, devpriv->int816_mode
will always be > 0 when it's used to set irq_was_now_closed in the cancel
function.
Convert the flags in the private data to bit-fields to save a bit of
space.
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>
These members of the private data don't do anything usefull. Just 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>
Use the subdevice (*cancel) operation to remove the need for a forward
declaration.
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>
The timer divisors are calculated in the (*do_cmdtest) before the (*do_cmd)
is called by the comedi core. The extra sanity checks in the (*do_cmd) are
not necessary, the values returned from i8253_cascade_ns_to_timer() will be
greater than 1. Save the values in the private data so they don't need to be
recalced.
Refactor pcl816_start_pacer() to use the values from the private data.
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 board types can use IRQ 2-7 for async command support. Remove
the 'IRQbits', which is a mask of the valid IRQs, from the boardinfo
and refactor pcl816_attach().
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 boardinfo is the same for all board types. Remove this
data from the boardinfo.
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 boardinfo is the same for all board types. Remove this
data from the boardinfo.
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>
In hwdrv_apci1564.c, one static variable is zero initialized. This is
unneeded and redundant, so we remove the initialization.
Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There were a small handful of printk() calls in hwdrv_apci1564.c. It is
generally better to use dev_err() for error messages instead, so I
switched all the printk() calls out, as well as cleaned up the error
strings.
Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hwdrv_apci1564.c had many single statments wrapped in braces, so we can
delete these. Also, some else statements were improperly placed, fix
these too.
Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hwdrv_apci1564.c had a lot of commented out conditional statements that
were often identical to other un-commented out statements nearby, so it
should be safe to just delete all of these commented out lines. This
patch also converts the remaining comments to the preferred kernel style
for comments.
Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
We should check the ring allocations don't fail.
If we get a fail we need to clean up properly. The allocator assumes the
deallocator will be used on failure, but it isn't. Make sure the
right deallocator is always called and add a missing check against
fbr allocation failure.
[v2]: Correct check logic
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The private data is kzalloc'ed in the (*attach). There is no need to
initialize and the members to 0.
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>
To better match the pcl818 and pcl816 drivers, allocate the private data before
calling comedi_request_region().
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 function probes a number of the boards registers during the
(*attach) to verify that it is actually a PCL-818 compatible board.
For aesthetics, move the function closer to the (*attach).
Refactor the function to return an errno if fails. Change the errno
from -EIO to -ENODEV and remove the unnecessary comedi_error() noise.
Make sure the CONTROL register is reset to a known state after the
check. The 0x18 value actually defines an invalid interrupt selection
and sets an undefined bit.
Add a couple comments to clarify the magic values.
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>
These comments are just added cruft. 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>
These comments are just added cruft. 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>
This member in the private data is a flag that indicates that an analog
input async command is currently running. Rename it to make this clear.
The private data is kzalloc'ed in the attach so remove the unnecessary
clearing of this flag.
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>
Convert the flags in the private data to bit-fields to save a bit of
space.
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>
Convert the flags in the private data to bit-fields to save a bit of
space.
Rename the CamelCase 'use_MPC' member.
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 private data is just a pointer to the cmd->chanlist.
Use that instead.
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 private data is just a copy of the cmd->chanlist. Use
that instead.
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>
These members of the private data are set but never used. 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>
The hardware does not have any analog output interrupt support. Remove the
stubbed in 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>
Use the subdevice (*cancel) operation to remove the need for a forward
declaration.
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>
Use the subdevice (*cancel) operation to remove the need for a forward
declaration.
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>
The timer divisors are calculated in the (*do_cmdtest) before the (*do_cmd)
is called by the comedi core. The extra sanity checks in the (*do_cmd) are
not necessary, the values returned from i8253_cascade_ns_to_timer() will be
greater than 1. Save the values in the private data so they don't need to be
recalced.
Refactor pcl818_start_pacer() to use the values from the private data.
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>
The timer divisors are calculated in the (*do_cmdtest) before the (*do_cmd)
is called by the comedi core. Save the values in the private data so they
don't need to be recalced.
Refactor pcl812_start_pacer() to use the values from the private data.
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>
These forward declarations are not needed.
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>
Use the helper functions in 8253.h to clarify the timer programming.
Move start_pacer() to remove the need for the forward declarations.
Rename the function so it has namespace associated with the driver.
Change the 'mode' parameter. This parameter is really a flag to the
function indicating if the divisors should be loaded into the timers.
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>
Use the helper functions in 8253.h to clarify the timer programming.
Move start_pacer() to remove the need for the forward declarations.
Rename the function so it has namespace associated with the driver.
Change the 'mode' parameter. This parameter is really a flag to the
function indicating if the divisors should be loaded into the timers.
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>
Use the helper functions in 8253.h to clarify the timer programming.
Move start_pacer() to remove the need for the forward declarations.
Rename the function so it has namespace associated with the driver.
Change the 'mode' parameter. This parameter is really a flag to the
function indicating if the divisors should be loaded into the timers.
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 private data is set but never used. Remove 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 private data is set but never used. Remove 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 driver uses 2 buffers for DMA. Refactor the buffer allocation to
use a for loop to remove code duplication. Remove the dev_err() messages
when __get_dma_pages() fails and change the errno returned from -EBUSY
to -ENOMEM.
Both buffers are the same size so replace the 'dmapages' and 'hwdmasize'
arrays in the private data with variables to save a bit of space.
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 driver uses 2 buffers for DMA. Refactor the buffer allocation to
use a for loop to remove code duplication. Remove the dev_err() messages
when __get_dma_pages() fails and change the errno returned from -EBUSY
to -ENOMEM.
Both buffers are the same size so replace the 'dmapages' and 'hwdmasize'
arrays in the private data with variables to save a bit of space.
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 driver uses 2 buffers for DMA. Refactor the buffer allocation to
use a for loop to remove code duplication. Remove the dev_err() messages
when __get_dma_pages() fails and change the errno returned from -EBUSY
to -ENOMEM.
Both buffers are the same size so replace the 'dmapages' and 'hwdmasize'
arrays in the private data with variables to save a bit of space.
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 private data is not used. Remove 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 private data is just a copy of the cmd->flags.
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 private data is just a copy of the cmd->chanlist_len.
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>