[PATCH] V4L: soc_camera: allow reading from video device if supported

2012-08-18 Thread Anatolij Gustschin
Try reading on video device. If the camera bus driver supports reading
we can try it and return the result. Also add a debug line.

Signed-off-by: Anatolij Gustschin ag...@denx.de
---
 drivers/media/platform/soc_camera.c |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/media/platform/soc_camera.c 
b/drivers/media/platform/soc_camera.c
index 10b57f8..d591a42 100644
--- a/drivers/media/platform/soc_camera.c
+++ b/drivers/media/platform/soc_camera.c
@@ -645,9 +645,16 @@ static ssize_t soc_camera_read(struct file *file, char 
__user *buf,
   size_t count, loff_t *ppos)
 {
struct soc_camera_device *icd = file-private_data;
+   struct soc_camera_host *ici = to_soc_camera_host(icd-parent);
int err = -EINVAL;
 
-   dev_err(icd-pdev, camera device read not implemented\n);
+   dev_dbg(icd-pdev, read called, buf %p\n, buf);
+
+   if (ici-ops-init_videobuf2  icd-vb2_vidq.io_modes  VB2_READ)
+   err = vb2_read(icd-vb2_vidq, buf, count, ppos,
+   file-f_flags  O_NONBLOCK);
+   else
+   dev_err(icd-pdev, camera device read not implemented\n);
 
return err;
 }
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


media_build duplicate module structures

2012-08-18 Thread Malcolm Priestley
Hi

Updating older kernels with media_build does not remove the old file
structure.

Running /sbin/depmod will mean the new structure will have two modules
of the same name causing module conflicts.

The entire old structure needs to be removed first.

rm -r /lib/modules/$(uname -r)/kernel/drivers/media

Regards


Malcolm



--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: STV0299: reading property DTV_FREQUENCY -- what am I expected to get?

2012-08-18 Thread Reinhard Nissl

Hi,

Am 16.08.2012 00:10, schrieb Mauro Carvalho Chehab:

The patch seems to be working. Anyway, for it to be merged, you'll
need to be sending it together with your SOB (Signed-off-by),
and using the -p1 format e. g. something like:

--- a/drivers/media/dvb/frontends/stb0899_drv.c 2012-08-14 21:59:59.0 
+0200
+++ b/drivers/media/dvb/frontends/stb0899_drv.c 2012-08-14 21:29:17.0 
+0200

as otherwise developer's scripts won't get it right.


I hope I got it right this time ;-)

Bye.
--
Dipl.-Inform. (FH) Reinhard Nissl
mailto:rni...@gmx.de
stb0899: return internally tuned frequency via get_frontend.

Signed-off-by: Reinhard Nißl rni...@gmx.de

diff --git a/drivers/media/dvb-frontends/stb0899_drv.c b/drivers/media/dvb-frontends/stb0899_drv.c
index 5d7f8a9..79e29de 100644
--- a/drivers/media/dvb-frontends/stb0899_drv.c
+++ b/drivers/media/dvb-frontends/stb0899_drv.c
@@ -1563,6 +1563,7 @@ static int stb0899_get_frontend(struct dvb_frontend *fe)
 
 	dprintk(state-verbose, FE_DEBUG, 1, Get params);
 	p-symbol_rate = internal-srate;
+	p-frequency = internal-freq;
 
 	return 0;
 }


How to add new chip ids to v4l2-chip-ident.h ?

2012-08-18 Thread Frank Schäfer
Hi,

I would like to know how to add new chip ids to v4l2-chip-ident.h. Ist
there a kind of policy for choosing numbers ?
Which numbers would be approriate for the em25xx/em26xx/em27xx/em28xx
chips ?
Unfortunately 2700 is already used by V4L2_IDENT_VP27SMPX...

Regards,
Frank Schäfer


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: How to add new chip ids to v4l2-chip-ident.h ?

2012-08-18 Thread Hans Verkuil
On Sat August 18 2012 16:19:26 Frank Schäfer wrote:
 Hi,
 
 I would like to know how to add new chip ids to v4l2-chip-ident.h. Ist
 there a kind of policy for choosing numbers ?

Using numbers that match the chip number is recommended, but if that can't
be done due to clashes, then pick some other, related, number (e.g. 12700
instead of 2700) or create a range of number for all possible models of that
chip series.

 Which numbers would be approriate for the em25xx/em26xx/em27xx/em28xx
 chips ?
 Unfortunately 2700 is already used by V4L2_IDENT_VP27SMPX...

Please note that adding an identifier to v4l2-chip-ident.h is only needed
if the VIDIOC_DBG_* ioctls are implemented. If those are not implemented,
then there is no need for an ID either.

Regards,

Hans
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Q] videbuf2 behavior when start_streaming fails

2012-08-18 Thread Ezequiel Garcia
Hello,

I was trying to debug a bug in stk1160, triggered by a low memory situation.
After some struggling I found out that I'm suppose to clear the queued buffers
if start_streaming() fails (which I wasn't doing).

This seems most awkward since I didn't queue the buffers in start_streaming,
but of course in buf_queue. So, it looks like a mixup to me.

Am I missing something? Was this documented anywhere?
Does this look odd to anyone, or is it just me being awfully newbie?

Thanks!
Ezequiel.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL FOR 3.7] Misc. fixes + shark improvements

2012-08-18 Thread Hans de Goede

Hi Mauro,

Please pull from my tree for a bunch of assorted fixes, as well
as AM tuning and suspend/resume for the radio-shark and radio-shark2
drivers.

The following changes since commit 9b78c5a3007e10a172d4e83bea18509fdff2e8e3:

  [media] b2c2: export b2c2_flexcop_debug symbol (2012-08-17 11:09:19 -0300)

are available in the git repository at:

  git://linuxtv.org/hgoede/gspca.git media-for_v3.7-wip

for you to fetch changes up to 7fd59dce24e2c57d2537ec827e0c7e09c7c1e77b:

  media-api-docs: Documented V4L2_TUNER_CAP_HWSEEK_PROG_LIM in G_TUNER docs 
(2012-08-18 17:35:48 +0200)


Emil Goode (1):
  gspca: dubious one-bit signed bitfield

Ezequiel Garcia (1):
  pwc: Use vb2 queue mutex through a single name

Hans de Goede (10):
  radio-shark*: Remove work-around for dangling pointer in usb intfdata
  radio-shark*: Call cancel_work_sync from disconnect rather then release
  radio-shark: Only compile led support when CONFIG_LED_CLASS is set
  radio-shark2: Only compile led support when CONFIG_LED_CLASS is set
  snd_tea575x: Add support for tuning AM
  radio-tea5777.c: Get rid of do_div usage
  radio-tea5777: Add support for tuning AM
  radio-shark2: Add support for suspend  resume
  radio-shark: Add support for suspend  resume
  media-api-docs: Documented V4L2_TUNER_CAP_HWSEEK_PROG_LIM in G_TUNER docs

 Documentation/DocBook/media/v4l/vidioc-g-tuner.xml |   6 +
 drivers/media/radio/radio-shark.c  | 195 
 drivers/media/radio/radio-shark2.c | 176 +++---
 drivers/media/radio/radio-tea5777.c| 197 +++-
 drivers/media/radio/radio-tea5777.h|   3 +
 drivers/media/usb/gspca/ov519.c|  16 +-
 drivers/media/usb/pwc/pwc-if.c |   2 +-
 include/sound/tea575x-tuner.h  |   4 +
 sound/i2c/other/tea575x-tuner.c| 200 +
 9 files changed, 570 insertions(+), 229 deletions(-)

Thanks,

Hans
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] ViewCast O820E capture support added

2012-08-18 Thread Steven Toth
Mauro, please read below, a new set of patches I'm submitting for merge.

On Thu, Aug 16, 2012 at 2:49 PM, Hans Verkuil hverk...@xs4all.nl wrote:
 On Thu August 16 2012 19:39:51 Steven Toth wrote:
  So, I've ran v4l2-compliance and it pointed out a few things that I've
  fixed, but it also does a few things that (for some reason) I can't
  seem to catch. One particular test is on (iirc) s_fmt. It attempts to
  set ATSC but by ioctl callback never receives ATSC in the norm/id arg,
  it actually receives 0x0. This feels more like a bug in the test.
  Either way, I have some if (std  ATSC) return -EINVAL, but it still
  appears to fail the test.

 Oddly enough. If I set tvnorms to something valid, then compliance
 passes but gstreamer
 fails to run, looks like some kind of confusion about either the
 current established
 norm, or a failure to establish a norm.

 For the time being I've set tvnorms to 0 (with a comment) and removed
 current_norm.

 Well, this needs to be sorted, because something is clearly amiss.

Agreed. I just can't see what's wrong. I may need your advise /
eyeballs on this. I'd be willing to provide logs that show gstreamer
accessing the driver and exiting. It needs fixed, I've tried, I just
can't see why gstreamer fails.

On the main topic of merge As promised, I spent quite a bit of
time this week reworking the code based on the feedback. I also
flattened all of these patches into a single patchset and upgraded to
the latest re-org tree.

The source notes describe in a little more detail the major changes:
http://git.kernellabs.com/?p=stoth/media_tree.git;a=commit;h=f295dd63e2f7027e327daad730eb86f2c17e3b2c

Mauro, so, I hereby submit for your review/merge again, the updated
patchset. *** Please comment. ***

The following changes since commit 9b78c5a3007e10a172d4e83bea18509fdff2e8e3:

  [media] b2c2: export b2c2_flexcop_debug symbol (2012-08-17 11:09:19 -0300)

are available in the git repository at:
  git://git.kernellabs.com/stoth/media_tree.git o820e

Steven Toth (4):
  [media] adv7441a: Adding limited support for a new video decoder.
  [media] adv7441a: Adding the module author macro
  [media] pcm3052: Adding support for a new ADC.
  [media] vc8x0: Adding support for the ViewCast O820E Capture Card.

 drivers/media/i2c/Kconfig |   18 +
 drivers/media/i2c/Makefile|2 +
 drivers/media/i2c/adv7441a.c  | 4258 +
 drivers/media/i2c/pcm3052.c   |  248 ++
 drivers/media/pci/Kconfig |1 +
 drivers/media/pci/Makefile|1 +
 drivers/media/pci/vc8x0/Kconfig   |   15 +
 drivers/media/pci/vc8x0/Makefile  |9 +
 drivers/media/pci/vc8x0/vc8x0-audio.c |  741 +
 drivers/media/pci/vc8x0/vc8x0-buffer.c|  338 +++
 drivers/media/pci/vc8x0/vc8x0-cards.c |  138 +
 drivers/media/pci/vc8x0/vc8x0-channel.c   |  805 ++
 drivers/media/pci/vc8x0/vc8x0-core.c  |  678 +
 drivers/media/pci/vc8x0/vc8x0-display.c   | 1359 +
 drivers/media/pci/vc8x0/vc8x0-dma.c   | 2677 ++
 drivers/media/pci/vc8x0/vc8x0-fw.c|  466 
 drivers/media/pci/vc8x0/vc8x0-i2c.c   |  368 +++
 drivers/media/pci/vc8x0/vc8x0-reg.h   |  214 ++
 drivers/media/pci/vc8x0/vc8x0-timestamp.c |  156 ++
 drivers/media/pci/vc8x0/vc8x0-video.c | 2796 +++
 drivers/media/pci/vc8x0/vc8x0.h   |  732 +
 include/media/adv7441a.h  |   88 +
 include/media/v4l2-chip-ident.h   |6 +
 23 files changed, 16114 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/i2c/adv7441a.c
 create mode 100644 drivers/media/i2c/pcm3052.c
 create mode 100644 drivers/media/pci/vc8x0/Kconfig
 create mode 100644 drivers/media/pci/vc8x0/Makefile
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-audio.c
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-buffer.c
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-cards.c
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-channel.c
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-core.c
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-display.c
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-dma.c
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-fw.c
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-i2c.c
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-reg.h
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-timestamp.c
 create mode 100644 drivers/media/pci/vc8x0/vc8x0-video.c
 create mode 100644 drivers/media/pci/vc8x0/vc8x0.h
 create mode 100644 include/media/adv7441a.h

Regards,

-- 
Steven Toth - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch] [media] rc: divide by zero bugs in s_tx_carrier()

2012-08-18 Thread Dan Carpenter
carrier comes from a get_user() in ir_lirc_ioctl().  We need to test
that it's not zero before using it as a divisor.

Signed-off-by: Dan Carpenter dan.carpen...@oracle.com

diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
index 647dd95..d05ac15 100644
--- a/drivers/media/rc/ene_ir.c
+++ b/drivers/media/rc/ene_ir.c
@@ -881,10 +881,13 @@ static int ene_set_tx_mask(struct rc_dev *rdev, u32 
tx_mask)
 static int ene_set_tx_carrier(struct rc_dev *rdev, u32 carrier)
 {
struct ene_device *dev = rdev-priv;
-   u32 period = 200 / carrier;
+   u32 period;
 
dbg(TX: attempt to set tx carrier to %d kHz, carrier);
+   if (carrier == 0)
+   return -EINVAL;
 
+   period = 200 / carrier;
if (period  (period  ENE_CIRMOD_PRD_MAX ||
period  ENE_CIRMOD_PRD_MIN)) {
 
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index 699eef3..2ea913a 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -517,6 +517,9 @@ static int nvt_set_tx_carrier(struct rc_dev *dev, u32 
carrier)
struct nvt_dev *nvt = dev-priv;
u16 val;
 
+   if (carrier == 0)
+   return -EINVAL;
+
nvt_cir_reg_write(nvt, 1, CIR_CP);
val = 300 / (carrier) - 1;
nvt_cir_reg_write(nvt, val  0xff, CIR_CC);
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] ViewCast O820E capture support added

2012-08-18 Thread Hans Verkuil
On Sat August 18 2012 17:48:52 Steven Toth wrote:
 Mauro, please read below, a new set of patches I'm submitting for merge.
 
 On Thu, Aug 16, 2012 at 2:49 PM, Hans Verkuil hverk...@xs4all.nl wrote:
  On Thu August 16 2012 19:39:51 Steven Toth wrote:
   So, I've ran v4l2-compliance and it pointed out a few things that I've
   fixed, but it also does a few things that (for some reason) I can't
   seem to catch. One particular test is on (iirc) s_fmt. It attempts to
   set ATSC but by ioctl callback never receives ATSC in the norm/id arg,
   it actually receives 0x0. This feels more like a bug in the test.
   Either way, I have some if (std  ATSC) return -EINVAL, but it still
   appears to fail the test.
 
  Oddly enough. If I set tvnorms to something valid, then compliance
  passes but gstreamer
  fails to run, looks like some kind of confusion about either the
  current established
  norm, or a failure to establish a norm.
 
  For the time being I've set tvnorms to 0 (with a comment) and removed
  current_norm.
 
  Well, this needs to be sorted, because something is clearly amiss.
 
 Agreed. I just can't see what's wrong. I may need your advise /
 eyeballs on this. I'd be willing to provide logs that show gstreamer
 accessing the driver and exiting. It needs fixed, I've tried, I just
 can't see why gstreamer fails.

You definitely need to set tvnorms for the video node as well. Take a look
at v4l_s_std in v4l2-ioctl.c: if tvnorms == 0, then your s_std function
is called with a std of 0 as well. The v4l_s_std function could do with a
WARN_ON(!vfd-tvnorms), by the way. This is why that ATSC test is also
always failing (and so can be removed).

The tvnorms value for the vbi and video node must also be identical.

You can easily debug what gstreamer is doing by running:

echo 2 /sys/class/video4linux/video0/debug

This will turn on core logging of all v4l2 ioctls, and it should help you
figuring out why gstreamer is failing.

This debug facility is new and is very handy.

One small thing I saw in querycap: don't set cap-version. The core sets that
to the kernel version automatically (and if built with media_build, then it's
set to the kernel version of the media tree).

There are still a few blocking issues here that I've told you about before.
Ignore this if you were planning to do that in a next version of the patch.

- use the control framework in the bridge driver
- use struct v4l2_fh

It's all trivial to add and you get control events and prio handling all for
free. I'm almost tempted to do it for you since it's 1 hour work tops for me,
but that's not really my job.

- use the new dv_timings API for the HDTV formats, both in the bridge driver
  and in the adv7441a driver.

This really must be done. As I mentioned before: I didn't implement this for
nothing. It's easy to test this with the qv4l2 utility which fully supports the
new API.

If you need help with any of this, please mail me and we can set up an irc
session.

I also strongly recommend using vb2 instead of videobuf. It's so much better.

What I don't quite understand BTW is how you detect and set formats for the
adv7441 driver. You must have something similar to VIDIOC_QUERY_DV_TIMINGS or
VIDIOC_S_DV_TIMINGS, but I don't see it offhand. How does this work?

Regards,

Hans

 On the main topic of merge As promised, I spent quite a bit of
 time this week reworking the code based on the feedback. I also
 flattened all of these patches into a single patchset and upgraded to
 the latest re-org tree.
 
 The source notes describe in a little more detail the major changes:
 http://git.kernellabs.com/?p=stoth/media_tree.git;a=commit;h=f295dd63e2f7027e327daad730eb86f2c17e3b2c
 
 Mauro, so, I hereby submit for your review/merge again, the updated
 patchset. *** Please comment. ***
 
 The following changes since commit 9b78c5a3007e10a172d4e83bea18509fdff2e8e3:
 
   [media] b2c2: export b2c2_flexcop_debug symbol (2012-08-17 11:09:19 -0300)
 
 are available in the git repository at:
   git://git.kernellabs.com/stoth/media_tree.git o820e
 
 Steven Toth (4):
   [media] adv7441a: Adding limited support for a new video decoder.
   [media] adv7441a: Adding the module author macro
   [media] pcm3052: Adding support for a new ADC.
   [media] vc8x0: Adding support for the ViewCast O820E Capture Card.
 
  drivers/media/i2c/Kconfig |   18 +
  drivers/media/i2c/Makefile|2 +
  drivers/media/i2c/adv7441a.c  | 4258 
 +
  drivers/media/i2c/pcm3052.c   |  248 ++
  drivers/media/pci/Kconfig |1 +
  drivers/media/pci/Makefile|1 +
  drivers/media/pci/vc8x0/Kconfig   |   15 +
  drivers/media/pci/vc8x0/Makefile  |9 +
  drivers/media/pci/vc8x0/vc8x0-audio.c |  741 +
  drivers/media/pci/vc8x0/vc8x0-buffer.c|  338 +++
  drivers/media/pci/vc8x0/vc8x0-cards.c |  138 +
  

cron job: media_tree daily build: ERRORS

2012-08-18 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:Sat Aug 18 19:00:20 CEST 2012
git hash:9b78c5a3007e10a172d4e83bea18509fdff2e8e3
gcc version:  i686-linux-gcc (GCC) 4.7.1
host hardware:x86_64
host os:  3.4.07-marune

linux-git-arm-eabi-davinci: ERRORS
linux-git-arm-eabi-exynos: ERRORS
linux-git-arm-eabi-omap: ERRORS
linux-git-i686: WARNINGS
linux-git-m32r: WARNINGS
linux-git-mips: ERRORS
linux-git-powerpc64: WARNINGS
linux-git-x86_64: WARNINGS
linux-2.6.31.12-x86_64: WARNINGS
linux-2.6.32.6-x86_64: WARNINGS
linux-2.6.33-x86_64: WARNINGS
linux-2.6.34-x86_64: WARNINGS
linux-2.6.35.3-x86_64: WARNINGS
linux-2.6.36-x86_64: WARNINGS
linux-2.6.37-x86_64: WARNINGS
linux-2.6.38.2-x86_64: WARNINGS
linux-2.6.39.1-x86_64: WARNINGS
linux-3.0-x86_64: WARNINGS
linux-3.1-x86_64: WARNINGS
linux-3.2.1-x86_64: WARNINGS
linux-3.3-x86_64: WARNINGS
linux-3.4-x86_64: WARNINGS
linux-3.5-x86_64: WARNINGS
linux-3.6-rc2-x86_64: WARNINGS
linux-2.6.31.12-i686: WARNINGS
linux-2.6.32.6-i686: WARNINGS
linux-2.6.33-i686: WARNINGS
linux-2.6.34-i686: WARNINGS
linux-2.6.35.3-i686: WARNINGS
linux-2.6.36-i686: WARNINGS
linux-2.6.37-i686: WARNINGS
linux-2.6.38.2-i686: WARNINGS
linux-2.6.39.1-i686: WARNINGS
linux-3.0-i686: WARNINGS
linux-3.1-i686: WARNINGS
linux-3.2.1-i686: WARNINGS
linux-3.3-i686: WARNINGS
linux-3.4-i686: WARNINGS
linux-3.5-i686: WARNINGS
linux-3.6-rc2-i686: WARNINGS
apps: WARNINGS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.tar.bz2

The V4L-DVB specification from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/5] drivers/media/video/gspca/cpia1.c: introduce missing initialization

2012-08-18 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr

The result of one call to a function is tested, and then at the second call
to the same function, the previous result, and not the current result, is
tested again.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// smpl
@@
expression ret;
identifier f;
statement S1,S2;
@@

*ret = f(...);
if (\(ret != 0\|ret  0\|ret == NULL\)) S1
... when any
*f(...);
if (\(ret != 0\|ret  0\|ret == NULL\)) S2
// /smpl

Signed-off-by: Julia Lawall julia.law...@lip6.fr

---
 drivers/media/video/gspca/cpia1.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/video/gspca/cpia1.c 
b/drivers/media/video/gspca/cpia1.c
index 2499a88..b3ba47d 100644
--- a/drivers/media/video/gspca/cpia1.c
+++ b/drivers/media/video/gspca/cpia1.c
@@ -751,7 +751,7 @@ static int goto_high_power(struct gspca_dev *gspca_dev)
if (signal_pending(current))
return -EINTR;
 
-   do_command(gspca_dev, CPIA_COMMAND_GetCameraStatus, 0, 0, 0, 0);
+   ret = do_command(gspca_dev, CPIA_COMMAND_GetCameraStatus, 0, 0, 0, 0);
if (ret)
return ret;
 

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/5] drivers/media/video/mt9m032.c: introduce missing initialization

2012-08-18 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr

The result of one call to a function is tested, and then at the second call
to the same function, the previous result, and not the current result, is
tested again.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// smpl
@@
expression ret;
identifier f;
statement S1,S2;
@@

*ret = f(...);
if (\(ret != 0\|ret  0\|ret == NULL\)) S1
... when any
*f(...);
if (\(ret != 0\|ret  0\|ret == NULL\)) S2
// /smpl

Signed-off-by: Julia Lawall julia.law...@lip6.fr

---
 drivers/media/video/mt9m032.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/video/mt9m032.c b/drivers/media/video/mt9m032.c
index 445359c..f80c1d7 100644
--- a/drivers/media/video/mt9m032.c
+++ b/drivers/media/video/mt9m032.c
@@ -781,7 +781,7 @@ static int mt9m032_probe(struct i2c_client *client,
ret = mt9m032_write(client, MT9M032_RESET, 1);  /* reset on */
if (ret  0)
goto error_entity;
-   mt9m032_write(client, MT9M032_RESET, 0);/* reset off */
+   ret = mt9m032_write(client, MT9M032_RESET, 0);  /* reset off */
if (ret  0)
goto error_entity;
 

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/5] drivers/media/video/m5mols/m5mols_core.c: introduce missing initialization

2012-08-18 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr

The result of one call to a function is tested, and then at the second call
to the same function, the previous result, and not the current result, is
tested again.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// smpl
@@
expression ret;
identifier f;
statement S1,S2;
@@

*ret = f(...);
if (\(ret != 0\|ret  0\|ret == NULL\)) S1
... when any
*f(...);
if (\(ret != 0\|ret  0\|ret == NULL\)) S2
// /smpl

Signed-off-by: Julia Lawall julia.law...@lip6.fr

---
 drivers/media/video/m5mols/m5mols_core.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/video/m5mols/m5mols_core.c 
b/drivers/media/video/m5mols/m5mols_core.c
index ac7d28b..0f521f5 100644
--- a/drivers/media/video/m5mols/m5mols_core.c
+++ b/drivers/media/video/m5mols/m5mols_core.c
@@ -937,7 +937,7 @@ static int __devinit m5mols_probe(struct i2c_client *client,
if (!ret)
ret = m5mols_init_controls(sd);
 
-   m5mols_sensor_power(info, false);
+   ret = m5mols_sensor_power(info, false);
if (!ret)
return 0;
 out_me:

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] winbond-cir: Fix initialization

2012-08-18 Thread David Härdeman
On Tue, Jul 31, 2012 at 11:37:03AM +0100, Sean Young wrote:
The serial driver will detect the winbond cir device as a serial port,
since it looks exactly like a serial port unless you know what it is
from the PNP ID.

Winbond CIR 00:04: Region 0x2f8-0x2ff already in use!
Winbond CIR 00:04: disabled
Winbond CIR: probe of 00:04 failed with error -16

The proposed solution means that a serial port will show up and then
automagically disappear (potentially) during boot, which isn't very
elegant.

When I discussed this a long time ago with Alan Cox (while he was still
the serial maintainer) I got the feeling that he was advocating
implementing a PNP ID based blacklist in the serial driver (apologies to
Alan if I misrepresented him now).

That seems to be a better solution (one that I never got around to
implementing myself).


Signed-off-by: Sean Young s...@mess.org
---
 drivers/media/rc/winbond-cir.c | 21 -
 drivers/tty/serial/8250/8250.c |  1 +
 2 files changed, 21 insertions(+), 1 deletion(-)

(BTW, I'm on vacation with sporadic Internet access for two more weeks,
and when I return I'll be spending most of my spare time moving in to a
new apartment, expect slow turnaround times for replying to emails).


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html