Jonathan Nieder [Sun, 1 May 2011 09:30:46 +0000 (06:30 -0300)]
[media] cx88: gracefully reject attempts to use unregistered cx88-blackbird driver
It should not be possible to enter mpeg_open and acquire core->lock
without the blackbird driver being registered, so just error out if it
is not. This makes the code more readable and should prevent the bug
fixed by the patch "hold device lock during sub-driver initialization"
from resurfacing again.
Similarly, if we enter mpeg_release and acquire core->lock then either
the blackbird driver is registered (since open files keep it loaded)
or the sysadmin forced the driver's removal. In the latter case the
state will be inconsistent and this is worth a loud warning.
Tested-by: Andi Huber <hobrom@gmx.at>
Tested-by: Marlon de Boer <marlon@hyves.nl>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Sun, 1 May 2011 09:30:14 +0000 (06:30 -0300)]
[media] cx88: protect cx8802_devlist with a mutex
Add and use a mutex to protect the cx88-mpeg device list. Previously
the BKL prevented races.
Based on work by Ben Hutchings <ben@decadent.org.uk>.
Tested-by: Andi Huber <hobrom@gmx.at>
Tested-by: Marlon de Boer <marlon@hyves.nl>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Sun, 1 May 2011 09:29:56 +0000 (06:29 -0300)]
[media] cx88: hold device lock during sub-driver initialization
cx8802_blackbird_probe makes a device node for the mpeg sub-device
before it has been added to dev->drvlist. If the device is opened
during that time, the open succeeds but request_acquire cannot be
called, so the reference count remains zero. Later, when the device
is closed, the reference count becomes negative --- uh oh.
Close the race by holding core->lock during probe and not releasing
until the device is in drvlist and initialization finished.
Previously the BKL prevented this race.
Reported-by: Andreas Huber <hobrom@gmx.at>
Tested-by: Andi Huber <hobrom@gmx.at>
Tested-by: Marlon de Boer <marlon@hyves.nl>
Cc: stable@kernel.org
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Sun, 1 May 2011 09:29:37 +0000 (06:29 -0300)]
[media] cx88: fix locking of sub-driver operations
The BKL conversion of this driver seems to have gone wrong.
Loading the cx88-blackbird driver deadlocks.
The cause: mpeg_ops::open in the cx2388x blackbird driver acquires the
device lock and calls the sub-driver's request_acquire, which tries to
acquire the lock again. Fix it by clarifying the semantics of
request_acquire, request_release, advise_acquire, and advise_release:
now all will rely on the caller to acquire the device lock.
Based on work by Ben Hutchings <ben@decadent.org.uk>.
Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=31962
Reported-by: Andi Huber <hobrom@gmx.at>
Tested-by: Andi Huber <hobrom@gmx.at>
Tested-by: Marlon de Boer <marlon@hyves.nl>
Cc: stable@kernel.org
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Sun, 1 May 2011 09:29:16 +0000 (06:29 -0300)]
[media] cx88: protect per-device driver list with device lock
The BKL conversion of this driver seems to have gone wrong. Various
uses of the sub-device and driver lists appear to be subject to race
conditions.
In particular, some functions access drvlist without a relevant lock
held, which will race against removal of drivers. Let's start with
that --- clean up by consistently protecting dev->drvlist with
dev->core->lock, noting driver functions that require the device lock
to be held or not to be held.
After this patch, there are still some races --- e.g.,
cx8802_blackbird_remove can run between the time the blackbird driver
is acquired and the time it is used in mpeg_release, and there's a
similar race in cx88_dvb_bus_ctrl. Later patches will address the
remaining known races and the deadlock noticed by Andi. This patch
just makes the semantics clearer in preparation for those later
changes.
Based on work by Ben Hutchings <ben@decadent.org.uk>.
Tested-by: Andi Huber <hobrom@gmx.at>
Tested-by: Marlon de Boer <marlon@hyves.nl>
Cc: stable@kernel.org
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
HIRANO Takahito [Sun, 1 May 2011 05:29:40 +0000 (02:29 -0300)]
[media] Fix panic on loading earth-pt1
Signed-off-by: HIRANO Takahito <hiranotaka@zng.info>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Ondrej Zary [Wed, 27 Apr 2011 20:35:45 +0000 (17:35 -0300)]
[media] usbvision: remove broken testpattern
Enabling force_testpattern module parameter in usbvision causes kernel panic.
Things like that does not belong to the kernel anyway so the fix is easy.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Ondrej Zary [Wed, 27 Apr 2011 20:36:05 +0000 (17:36 -0300)]
[media] usbvision: add Nogatech USB MicroCam
Add Nogatech USB MicroCam PAL (NV3001P) and NTSC (NV3000N) support to
usbvision driver.
PAL version is tested, NTSC untested.
Data captured using usbsnoop, init_values are listed in the INF file along
with image dimensions, offsets and frame rates.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Malcolm Priestley [Fri, 22 Apr 2011 09:20:57 +0000 (06:20 -0300)]
[media] lmedm04: PID filtering changes
Improve PID filtering and program register 20 correctly.
Make sure stream_on message is sent if streaming is off, otherwise
PIDs are not registered.
Move mutex outside lme2510_enable_pid.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Malcolm Priestley [Fri, 22 Apr 2011 09:07:40 +0000 (06:07 -0300)]
[media] lmedm04: don't write to buffer without a mutex
usb_buffer not inside mutex lock, waiting caller can alter buffer.
Static added to lme2510_exit and lme2510_exit_int.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Malcolm Priestley [Fri, 22 Apr 2011 09:00:22 +0000 (06:00 -0300)]
[media] IX2505V Keep I2C gate control alive
Gate could close after first I2C message. On stv0288 it does.
Keep 2nd and 3rd message I2C gate control alive.
Remove unnecessary gate closing in this module.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jesper Juhl [Thu, 21 Apr 2011 21:11:25 +0000 (18:11 -0300)]
[media] Media, DVB, Siano, smsusb: Avoid static analysis report about 'use after free'
In drivers/media/dvb/siano/smsusb.c we have this code:
...
kfree(dev);
sms_info("device %p destroyed", dev);
...
at least one static analysis tool (Coverity Prevent) complains about this
as a use-after-free bug.
While it's true that we do use the pointer variable after freeing it, the
only use is to print the value of the pointer, so there's not actually any
problem here. But still, silencing the complaint is trivial by just moving
the kfree() call below the sms_info(), so why not just do it?. It doesn't
change the workings of the code in any way, but it makes the tool shut up.
The patch below also removes a rather pointless blank line.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Wed, 20 Apr 2011 21:43:24 +0000 (18:43 -0300)]
[media] tm6000: add detection based on eeprom name
On some situations, it is desired to use eeprom data to detect
the board type. This patch adds a logic for it and fixes 2 detection
issues:
1) 10Moons UT-821 uses a generic Trident ID. Other boards
also share the same ID. So, better to use an alternative way for
it;
2) Sometimes, HVR-900H is loaded with the default Trident
ID. This seems to be some hardware bug or race condition.
The new logic will only be enabled if the device is detected as
having a generic ID.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Malcolm Priestley [Sun, 17 Apr 2011 19:55:14 +0000 (16:55 -0300)]
[media] dvb-usb: don't return error if stream stop
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Malcolm Priestley [Sat, 16 Apr 2011 16:30:32 +0000 (13:30 -0300)]
[media] dvb-usb return device errors to demuxer
Return device errors to demuxer from on/off streamming and
pid filtering.
Please test this patch with all dvb-usb devices.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Alexey Khoroshilov [Fri, 15 Apr 2011 20:40:17 +0000 (17:40 -0300)]
[media] lmedm04: Do not unlock mutex if mutex_lock_interruptible failed
There are a couple of places where mutex_unlock() is called even
if mutex_lock_interruptible() failed. The patch fixes the issue.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Márcio Alves [Mon, 11 Apr 2011 22:57:15 +0000 (19:57 -0300)]
[media] cx231xx: add support for Kworld
[mchehab@redhat.com: avoided board renumberation, removed an unused #define
and re-used the existing mb86a20s dvb attach code]
Signed-off-by: Márcio A Alves <froooozen@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Marko Ristola [Fri, 8 Apr 2011 15:40:51 +0000 (12:40 -0300)]
[media] Speed up DVB TS stream delivery from DMA buffer into dvb-core's buffer
Avoid unnecessary DVB TS 188 sized packet copying from DMA buffer into stack.
Backtrack one 188 sized packet just after some garbage bytes when possible.
This obsoletes patch https://patchwork.kernel.org/patch/118147/
Signed-off-by: Marko Ristola <marko.ristola@kolumbus.fi>
Acked-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jesper Juhl [Thu, 7 Apr 2011 19:23:48 +0000 (16:23 -0300)]
[media] cx23885: Don't leak firmware in cx23885_card_setup()
We leak the memory allocated to 'fw' (the firmware) when the variable goes
out of scope.
Fix the leak by calling release_firmware(fw) before 'fw' goes out of
scope.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jesper Juhl [Thu, 7 Apr 2011 19:34:30 +0000 (16:34 -0300)]
[media] DVB, DiB9000: Fix leak in dib9000_attach()
If the second memory allocation in dib9000_attach() fails, we'll leak the
memory allocated by the first.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Steven Toth [Wed, 6 Apr 2011 11:32:56 +0000 (08:32 -0300)]
[media] cx18: mmap() support for raw YUV video capture
Add support for mmap method streaming of raw YUV video on cx18-based
hardware, in addition to the existing support for read() streaming of
raw YUV and MPEG-2 encoded video.
[simon.farnsworth@onelan.co.uk: I forward-ported this from Steven's original work,
done under contract to ONELAN. The original code is at
http://www.kernellabs.com/hg/~stoth/cx18-videobuf]
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Stefan Ringel [Mon, 4 Apr 2011 20:18:44 +0000 (17:18 -0300)]
[media] tm6000: add CARDLIST
add CARDLIST
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sensoray Linux Development [Mon, 4 Apr 2011 18:23:03 +0000 (15:23 -0300)]
[media] s2255drv: jpeg enable module parameter
Adding jpeg enable module parameter.
Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sensoray Linux Development [Mon, 4 Apr 2011 18:16:26 +0000 (15:16 -0300)]
[media] s2255drv: adding MJPEG format
adding MJPEG format
Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Thiago Farina [Sun, 3 Apr 2011 22:50:14 +0000 (19:50 -0300)]
[media] wl128x: Remove unused NO_OF_ENTRIES_IN_ARRAY macro
Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Malcolm Priestley [Sat, 2 Apr 2011 21:59:29 +0000 (18:59 -0300)]
[media] DM04/QQBOX v1.84 added PID filter
A greatly simplified version of the PID Filter now added
back to the Driver.
The driver allows for the PID filter to be turned off.
applied after patch 683781.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Malcolm Priestley [Sat, 2 Apr 2011 13:51:53 +0000 (10:51 -0300)]
[media] STV0288 Register 42 - Incorrect settings
Register 42 bits 2,3,6 and 7 should be set to 0.
This gives difficult locking on some channels and may be compensated
for by other methods.
This affects any driver using the stv0288 frontend on the default
or earda inittab.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Malcolm Priestley [Sat, 2 Apr 2011 13:47:50 +0000 (10:47 -0300)]
[media] DM04/QQBOX stv0288 register 42 - incorrect setting
stv0288 Register 42 bits 6 & 7 should be set to 0.
This is causing intermittent lock, the dvb-usb-lmedm04 driver uses
register 50 (auto fine mode) to correct for this, this register is
now returned to its default setting.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Pete Eberlein [Sat, 2 Apr 2011 00:21:26 +0000 (21:21 -0300)]
[media] s2255drv: atomic submit urb in completion handler
An usb_submit_urb should be atomic in a completion handler. This fixes
"BUG: scheduling while atomic" messages.
Signed-off-by: Pete Eberlein <pete@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Oliver Endriss [Tue, 29 Mar 2011 20:37:00 +0000 (17:37 -0300)]
[media] budget-ci: Add support for TT S-1500 with BSBE1-D01A tuner
Add support for TT S-1500 with BSBE1-D01A tuner.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Petter Selasky [Mon, 28 Mar 2011 17:37:36 +0000 (14:37 -0300)]
[media] cx24116.c - fix for wrong parameter description
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jean-Francois Moine [Sun, 27 Mar 2011 07:11:48 +0000 (04:11 -0300)]
[media] pwc: Handle V4L2_CTRL_FLAG_NEXT_CTRL in queryctrl
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mariusz Kozlowski [Sat, 26 Mar 2011 18:23:56 +0000 (15:23 -0300)]
[media] dib0700: fix possible NULL pointer dereference
Seems like 'adap->fe' test for NULL was meant to be before we dereference
that pointer.
Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl>
Acked-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dan Carpenter [Sat, 26 Mar 2011 01:54:34 +0000 (22:54 -0300)]
[media] pvrusb2: delete generic_standards_cnt
The generic_standards_cnt define is only used in one place and it's
more readable to just call ARRAY_SIZE(generic_standards) directly.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dan Carpenter [Sat, 26 Mar 2011 01:52:22 +0000 (22:52 -0300)]
[media] pvrusb2: check for allocation failures
This function returns NULL on failure so lets do that if kzalloc()
fails. There is a separate problem that the caller for this function
doesn't check for errors...
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-By: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Timothy Lee [Fri, 25 Mar 2011 18:00:33 +0000 (15:00 -0300)]
[media] saa7134: support MagicPro ProHDTV Pro2 Hybrid DMB-TH PCI card
This card has a TD18271 silicon tuner, and uses TDA8290 and LGS8G75 to
demodulate analog and digital broadcast respectively. GPIO configurations
were derived using DScaler regspy.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jean Delvare [Wed, 23 Mar 2011 13:35:57 +0000 (10:35 -0300)]
[media] zoran: Drop unused module parameters encoder and decoder
The ability to force the encoder or decoder chip was broken by commit
0ab6e1c38d80ab586e3a1ca9e71844131d9f51dc in February 2009. As nobody
complained for over 2 years, I take it that these parameters were no
longer used so we can simply drop them.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Sun, 20 Mar 2011 21:50:52 +0000 (18:50 -0300)]
[media] lmedm04: get rid of on-stack dma buffers
usb_control_msg initiates (and waits for completion of) a dma transfer using
the supplied buffer. That buffer thus has to be seperately allocated on
the heap.
In lib/dma_debug.c the function check_for_stack even warns about it:
WARNING: at lib/dma-debug.c:866 check_for_stack
Tested-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Florian Mickler <florian@mickler.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Sun, 20 Mar 2011 21:50:50 +0000 (18:50 -0300)]
[media] au6610: get rid of on-stack dma buffer
usb_control_msg initiates (and waits for completion of) a dma transfer using
the supplied buffer. That buffer thus has to be seperately allocated on
the heap.
In lib/dma_debug.c the function check_for_stack even warns about it:
WARNING: at lib/dma-debug.c:866 check_for_stack
Signed-off-by: Florian Mickler <florian@mickler.org>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Sun, 20 Mar 2011 21:50:49 +0000 (18:50 -0300)]
[media] ce6230: get rid of on-stack dma buffer
usb_control_msg initiates (and waits for completion of) a dma transfer using
the supplied buffer. That buffer thus has to be seperately allocated on
the heap.
In lib/dma_debug.c the function check_for_stack even warns about it:
WARNING: at lib/dma-debug.c:866 check_for_stack
Signed-off-by: Florian Mickler <florian@mickler.org>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Sun, 20 Mar 2011 21:50:48 +0000 (18:50 -0300)]
[media] ec168: get rid of on-stack dma buffers
usb_control_msg initiates (and waits for completion of) a dma transfer using
the supplied buffer. That buffer thus has to be seperately allocated on
the heap.
In lib/dma_debug.c the function check_for_stack even warns about it:
WARNING: at lib/dma-debug.c:866 check_for_stack
Signed-off-by: Florian Mickler <florian@mickler.org>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 10:19:14 +0000 (07:19 -0300)]
[media] vp702x: use preallocated buffer in the frontend
Note: This change is tested to compile only as I don't have the
hardware.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 10:19:13 +0000 (07:19 -0300)]
[media] vp702x: use preallocated buffer in vp702x_usb_inout_cmd
If we need a bigger buffer, we reallocte a new buffer and free the old
one.
Note: This change is tested to compile only as I don't have the
hardware.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 10:19:12 +0000 (07:19 -0300)]
[media] vp702x: use preallocated buffer
Note: This change is tested to compile only as I don't have the
hardware.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 10:19:11 +0000 (07:19 -0300)]
[media] vp702x: fix locking of usb operations
Otherwise it is not obvious that vp702x_usb_in_op or vp702x_usb_out_op
will not interfere with any vp702x_usb_inout_op.
Note: This change is tested to compile only, as I don't have the
hardware.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 10:19:10 +0000 (07:19 -0300)]
[media] vp702x: get rid of on-stack dma buffers
usb_control_msg initiates (and waits for completion of) a dma transfer using
the supplied buffer. That buffer thus has to be seperately allocated on
the heap.
In lib/dma_debug.c the function check_for_stack even warns about it:
WARNING: at lib/dma-debug.c:866 check_for_stack
Note: This change is tested to compile only, as I don't have the hardware.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 10:19:09 +0000 (07:19 -0300)]
[media] vp702x: remove unused variable
struct vp702x_device_state.power_state is nowhere referenced.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 10:19:08 +0000 (07:19 -0300)]
[media] vp702x: preallocate memory on device probe
This sets up a buffer and a mutex protecting that buffer in
the struct vp702x_device_state.
The definition of struct vp702x_device_state is moved into the header
in order to use the buffer also in the frontend.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 10:19:07 +0000 (07:19 -0300)]
[media] vp702x: rename struct vp702x_state -> vp702x_adapter_state
We need a state struct for the dvb_usb_device.
In order to reduce confusion we rename the vp702x_state struct.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 10:19:06 +0000 (07:19 -0300)]
[media] vp702x: cleanup: whitespace and indentation
Some whitespace, one linebreak and one unneded variable
initialization...
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 18:33:46 +0000 (15:33 -0300)]
[media] opera1: get rid of on-stack dma buffer
usb_control_msg initiates (and waits for completion of) a dma transfer using
the supplied buffer. That buffer thus has to be seperately allocated on
the heap.
In lib/dma_debug.c the function check_for_stack even warns about it:
WARNING: at lib/dma-debug.c:866 check_for_stack
Note: This change is tested to compile only, as I don't have the hardware.
Signed-off-by: Florian Mickler <florian@mickler.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 18:33:45 +0000 (15:33 -0300)]
[media] m920x: get rid of on-stack dma buffers
usb_control_msg initiates (and waits for completion of) a dma transfer using
the supplied buffer. That buffer thus has to be seperately allocated on
the heap.
In lib/dma_debug.c the function check_for_stack even warns about it:
WARNING: at lib/dma-debug.c:866 check_for_stack
Note: This change is tested to compile only, as I don't have the hardware.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 18:33:44 +0000 (15:33 -0300)]
[media] dw2102: get rid of on-stack dma buffer
usb_control_msg initiates (and waits for completion of) a dma transfer using
the supplied buffer. That buffer thus has to be seperately allocated on
the heap.
In lib/dma_debug.c the function check_for_stack even warns about it:
WARNING: at lib/dma-debug.c:866 check_for_stack
Note: This change is tested to compile only, as I don't have the hardware.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Igor M. Liplianin <liplianin@tut.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 18:33:43 +0000 (15:33 -0300)]
[media] friio: get rid of on-stack dma buffers
usb_control_msg initiates (and waits for completion of) a dma transfer using
the supplied buffer. That buffer thus has to be seperately allocated on
the heap.
In lib/dma_debug.c the function check_for_stack even warns about it:
WARNING: at lib/dma-debug.c:866 check_for_stack
Note: This change is tested to compile only, as I don't have the hardware.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Akihiro Tsukada <tskd2@yahoo.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 18:33:42 +0000 (15:33 -0300)]
[media] vp7045: get rid of on-stack dma buffers
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Mon, 21 Mar 2011 18:33:41 +0000 (15:33 -0300)]
[media] a800: get rid of on-stack dma buffers
usb_control_msg initiates (and waits for completion of) a dma transfer using
the supplied buffer. That buffer thus has to be seperately allocated on
the heap.
In lib/dma_debug.c the function check_for_stack even warns about it:
WARNING: at lib/dma-debug.c:866 check_for_stack
Note: This change is tested to compile only, as I don't have the hardware.
Signed-off-by: Florian Mickler <florian@mickler.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Sun, 3 Apr 2011 17:23:43 +0000 (14:23 -0300)]
[media] dib0700: remove unused variable
This variable is never used.
Signed-off-by: Florian Mickler <florian@mickler.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Olivier Grenie [Thu, 24 Mar 2011 12:32:26 +0000 (09:32 -0300)]
[media] DiB0700: get rid of on-stack dma buffers
This patch removes the on-stack buffers for USB DMA transfers.
This is an alternative version of the patch discussed by Florian here:
http://thread.gmane.org/gmane.linux.kernel/1115695/
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Florian Mickler [Sun, 20 Mar 2011 21:50:51 +0000 (18:50 -0300)]
[media] lmedm04: correct indentation
This should not change anything except whitespace.
Signed-off-by: Florian Mickler <florian@mickler.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Michael Jones [Wed, 16 Mar 2011 14:22:53 +0000 (11:22 -0300)]
[media] ignore Documentation/DocBook/media/
It only contains generated files
Signed-off-by: Michael Jones <michael.jones@matrix-vision.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Joonyoung Shim [Fri, 11 Mar 2011 06:54:48 +0000 (03:54 -0300)]
[media] radio-si470x: convert to use request_threaded_irq()
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Joonyoung Shim [Fri, 11 Mar 2011 06:54:47 +0000 (03:54 -0300)]
[media] radio-si470x: convert to dev_pm_ops
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Joonyoung Shim [Fri, 11 Mar 2011 06:54:46 +0000 (03:54 -0300)]
[media] radio-si470x: support seek and tune interrupt enable
Currently we use busy waiting to seek and tune, it can replace to
interrupt way. SI470X I2C driver supports interrupt way to week and tune
via this patch.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Mon, 11 Apr 2011 21:49:24 +0000 (18:49 -0300)]
[media] tm6000: fix vbuf may be used uninitialized
In commit
8aff8ba95155df, most of the manipulations to vbuf inside
copy_streams were gated on if !dev->radio, but one place that touches
vbuf lays outside those gates -- a memcpy of vbuf isn't NULL. If we
initialize vbuf to NULL, that memcpy will never happen in the case where
we do have dev->radio, and otherwise, in the !dev->radio case, the code
behaves exactly like it did prior to
8aff8ba95155df.
While we're at it, also fix an incorrectly indented closing brace for
one of the sections touching vbuf that is conditional on !dev->radio.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Thu, 24 Mar 2011 19:43:45 +0000 (16:43 -0300)]
[media] lirc_sasem: key debug spew off debug modparam
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Thu, 24 Mar 2011 15:56:16 +0000 (12:56 -0300)]
[media] ttusb-budget: driver has a debug param, use it
Remove DEBUG define, key debug spew off of the module's debug param that
already exists.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Tue, 19 Apr 2011 19:47:34 +0000 (16:47 -0300)]
[media] mceusb: Formosa e017 device has no tx
Per hardware provided to me, the Formosa Industrial Computing eHome
Infrared Receiver, 0x147a:0xe017, has no tx capability, it is rx only.
Thanks go to Paul Rae for the hardware.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Tue, 12 Apr 2011 16:38:27 +0000 (13:38 -0300)]
[media] rc/nuvoton-cir: enable CIR on w83667hg chip variant
Thanks to some excellent investigative work by Douglas Clowes, it was
uncovered that the older w83667hg Nuvoton chip functions with this
driver after actually enabling the CIR function via its multi-function
chip config register. The CIR and CIR wide-band sensor enable bits are
just in a different place on this hardware, so we only poke register
0x27 on 677 hardware now, and we poke register 0x2c on the 667 now.
Reported-by: Douglas Clowes <dclowes1@optusnet.com.au>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Tue, 12 Apr 2011 17:00:07 +0000 (14:00 -0300)]
[media] rc/nuvoton-cir: only warn about unknown chips
There are additional chip IDs that report a PNP ID of NTN0530, which we
were refusing to load on. Instead, lets just warn if we encounter an
unknown chip, as there's a chance it will work just fine.
Also, expand the list of known hardware to include both an earlier and a
later generation chip that this driver should function with. Douglas has
an older w83667hg variant, that with a touch more work, will be
supported by this driver, and Lutz has a newer w83677hg variant that
works without any further modifications to the driver.
Reported-by: Douglas Clowes <dclowes1@optusnet.com.au>
Reported-by: Lutz Sammer <johns98@gmx.net>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Tue, 5 Apr 2011 21:42:30 +0000 (18:42 -0300)]
[media] rc: further key name standardization
Use the newly introduced KEY_IMAGES where appropriate, and standardize
on KEY_MEDIA for media center/application launcher button (such as the
Windows logo key on the Windows Media Center Ed. remotes).
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Thu, 24 Mar 2011 15:59:10 +0000 (12:59 -0300)]
[media] mceusb: tivo transceiver should default to tivo keymap
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jarod Wilson [Thu, 24 Mar 2011 15:58:48 +0000 (12:58 -0300)]
[media] rc: add tivo/nero liquidtv keymap
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antonio Ospite [Thu, 7 Apr 2011 15:45:52 +0000 (12:45 -0300)]
[media] gspca - kinect: New subdriver for Microsoft Kinect
The Kinect sensor is a device used by Microsoft for its Kinect project,
which is a system for controller-less Human-Computer interaction
targeted for Xbox 360.
In the Kinect device, RGBD data is captured from two distinct sensors: a
regular RGB sensor and a monochrome sensor which, with the aid of a IR
structured light, captures what is finally exposed as a depth map; so
what we have is basically a Structured-light 3D scanner.
The Kinect gspca subdriver just supports the video stream for now,
exposing the output from the RGB sensor or the unprocessed output from
the monochrome sensor; it does not deal with the processed depth stream
yet, but it allows using the sensor as a Webcam or as an IR camera (an
external source of IR light might be needed for this use).
The low level implementation is based on code from the OpenKinect
project (http://openkinect.org).
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antonio Ospite [Thu, 7 Apr 2011 15:45:51 +0000 (12:45 -0300)]
[media] Add Y10B, a 10 bpp bit-packed greyscale format
Add a 10 bits per pixel greyscale format in a bit-packed array representation,
naming it Y10B. Such pixel format is supplied for instance by the Kinect
sensor device.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jean-François Moine [Tue, 19 Apr 2011 17:51:15 +0000 (14:51 -0300)]
[media] gspca - zc3xx: Adjust the mc501cb exchanges
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Patrice Chotard [Mon, 18 Apr 2011 20:42:06 +0000 (17:42 -0300)]
[media] gspca - jeilinj: add SPORTSCAM specific controls
Signed-off-by: Patrice CHOTARD <patricechotard@free.fr>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Patrice Chotard [Mon, 18 Apr 2011 20:40:54 +0000 (17:40 -0300)]
[media] gspca - jeilinj: Add SPORTSCAM_DV15 camera support
Signed-off-by: Patrice CHOTARD <patricechotard@free.fr>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Patrice Chotard [Mon, 18 Apr 2011 20:39:38 +0000 (17:39 -0300)]
[media] gspca - jeilinj: add 640*480 resolution support
Signed-off-by: Patrice CHOTARD <patricechotard@free.fr>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Patrice Chotard [Mon, 18 Apr 2011 20:38:37 +0000 (17:38 -0300)]
[media] gspca - jeilinj: use gspca_dev->usb_err to forward error to upper layer
Signed-off-by: Patrice CHOTARD <patricechotard@free.fr>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Patrice Chotard [Mon, 18 Apr 2011 20:37:06 +0000 (17:37 -0300)]
[media] gspca - jeilinj: suppress workqueue
Signed-off-by: Patrice CHOTARD <patricechotard@free.fr>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Michael Krufky [Thu, 17 Feb 2011 20:33:28 +0000 (17:33 -0300)]
[media] tveeprom: update hauppauge tuner list thru 174
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Michael Krufky [Sun, 17 Apr 2011 02:02:00 +0000 (23:02 -0300)]
[media] tveeprom: update hauppauge tuner list thru 169
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Tue, 12 Apr 2011 23:17:11 +0000 (20:17 -0300)]
[media] anysee: add more info about known board configs
Add some comments about known GPIO settings of supported board
versions.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Tue, 12 Apr 2011 22:49:25 +0000 (19:49 -0300)]
[media] anysee: add support for two byte I2C address
After that Anysee I2C adapter is capable of one and two byte long
I2C addresses in case of read from I2C bus.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Tue, 12 Apr 2011 22:43:30 +0000 (19:43 -0300)]
[media] anysee: enhance demod and tuner attach
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Tue, 12 Apr 2011 20:34:08 +0000 (17:34 -0300)]
[media] anysee: fix E30 Combo Plus TDA18212 DVB-T
Use correct I2C address for ZL10353 DVB-T demod.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Tue, 12 Apr 2011 13:22:47 +0000 (10:22 -0300)]
[media] anysee: fix E30 Combo Plus TDA18212 GPIO
Looks like it is IF route switch on IOE[0]. Set it correctly
to route signal from tuner to demod. Now it works for DVB-C too.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Sun, 10 Apr 2011 23:23:02 +0000 (20:23 -0300)]
[media] anysee: add support for Anysee E7 TC
It is ZL10353, TDA10023 and TDA18212.
Tuner is inside of Samsung DNOD44CDH086A tuner module.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Sun, 10 Apr 2011 23:14:50 +0000 (20:14 -0300)]
[media] anysee: add support for TDA18212 based E30 Combo Plus
New models have new NXP TDA18212 silicon tuner.
Not tested yet due to lack of HW...
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Sun, 10 Apr 2011 20:53:52 +0000 (17:53 -0300)]
[media] anysee: reimplement demod and tuner attach
Use board ID as base value when selecting correct hardware configuration.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Sun, 10 Apr 2011 00:13:33 +0000 (21:13 -0300)]
[media] anysee: change some messages
Print firmware version as two digit long (change from 3 to 2).
Windows app have changed that too. First byte was hard coded as 0.
Change email list address to report non-working device to current one.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Sun, 10 Apr 2011 00:00:51 +0000 (21:00 -0300)]
[media] anysee: fix multibyte I2C read
It can read more than one byte from I2C bus. Allow that.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Sat, 9 Apr 2011 23:50:07 +0000 (20:50 -0300)]
[media] anysee: I2C address fix
Switch from 8 bit notation to real 7 bit.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Sat, 9 Apr 2011 23:07:30 +0000 (20:07 -0300)]
[media] NXP TDA18212HN silicon tuner driver
New silicon tuner driver.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sun, 27 Mar 2011 03:43:30 +0000 (00:43 -0300)]
[media] cx18: Bump driver version, since a new class of HVR-1600 is properly supported
Make a user visible driver version change, for the inevitable user support
questions about why newer model HVR-1600's do not work with (older
versions of) the cx18 driver.
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sun, 27 Mar 2011 03:20:37 +0000 (00:20 -0300)]
[media] cx18: Make RF analog TV work for newer HVR-1600 models with silicon tuners
A previous changes which added the newer model HVR-1600's and DTV support for
them, neglected to add RF analog TV for them. Fix RF analog TV for the newer
HVR-1600's which have a worldwide analog tuner assembly with a TDA18271 tuner
and TDA8295 demodulator.
Thanks go to Jeff Campbell and Mike Bradley for reproting the problem, and
also to Mike Bradley for doing a lot of the legwork to figure out the tuner
reset GPIO line, the demodulator I2C address, and that the GPIOs have to be
reinitialized after a cardtype switch.
Reported-by: Jeff Campbell <jac1dlists@gmail.com>
Tested-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Fri, 25 Mar 2011 15:46:05 +0000 (12:46 -0300)]
[media] drxd: use mutex instead of semaphore
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Fri, 25 Mar 2011 15:38:56 +0000 (12:38 -0300)]
[media] Remove the now obsolete drx397xD
This was replaced by Micronas drxd driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Fri, 25 Mar 2011 15:10:05 +0000 (12:10 -0300)]
[media] drxd: CodingStyle cleanups
There are still lots of 80-columns warnings and a few errors
at some tables, but changing them would require more work and
with probably not much gain.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab [Fri, 25 Mar 2011 14:45:29 +0000 (11:45 -0300)]
[media] drxd: Don't use a macro for CHK_ERROR with a break inside
The macro is defined as:
#define CHK_ERROR(s) if( (status = s)<0 ) break
This sucks, as makes harder to debug if something got wrong and
there are more than one level of loops. Also, violates CodingStyle.
Fixed by this simple perl script:
while (<>) { $f.=$_; };
$f=~ s,\n\#define CHK_ERROR[^\n]+\n,\n,;
$f=~ s=(CHK_ERROR\(.*\,)\n\s+=\1 =g;
$f=~ s=(CHK_ERROR\(.*\,)\n\s+=\1 =g;
$f=~ s=(CHK_ERROR\(.*\,)\n\s+=\1 =g;
$f=~ s=(CHK_ERROR\(.*)\s+(\,)\n\s+=\1\2 =g;
$f=~ s=(CHK_ERROR\(.*)\s+(\,)\n\s+=\1\2 =g;
$f=~ s=(CHK_ERROR\(.*)\s+(\,)\n\s+=\1\2 =g;
$f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;,\n\1status = \2;\n\1if (status < 0)\n\1\tbreak;,g;
print $f;
Plus a few manual adjustments
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>