Re: [PATCH] smscoreapi: Make Siano firmware load more verbose

2013-05-12 Thread Sakari Ailus
Hi Roberto,

On Sat, May 11, 2013 at 12:53:29PM -0300, Roberto Alcântara wrote:
 Signed-off-by: Roberto Alcantara robe...@eletronica.org
 
 diff --git a/drivers/media/common/siano/smscoreapi.c
 b/drivers/media/common/siano/smscoreapi.c
 index 45ac9ee..dbe9b4d 100644
 --- a/drivers/media/common/siano/smscoreapi.c
 +++ b/drivers/media/common/siano/smscoreapi.c
 @@ -1154,7 +1154,7 @@ static int
 smscore_load_firmware_from_file(struct smscore_device_t *coredev,
 
  char *fw_filename = smscore_get_fw_filename(coredev, mode);
  if (!fw_filename) {
 -sms_info(mode %d not supported on this device, mode);
 +sms_err(mode %d not supported on this device, mode);
  return -ENOENT;
  }
  sms_debug(Firmware name: %s, fw_filename);
 @@ -1165,14 +1165,14 @@ static int
 smscore_load_firmware_from_file(struct smscore_device_t *coredev,
 
  rc = request_firmware(fw, fw_filename, coredev-device);
  if (rc  0) {
 -sms_info(failed to open \%s\, fw_filename);
 +sms_err(failed to open firmware file \%s\, fw_filename);
  return rc;
  }
  sms_info(read fw %s, buffer size=0x%zx, fw_filename, fw-size);
  fw_buf = kmalloc(ALIGN(fw-size, SMS_ALLOC_ALIGNMENT),
   GFP_KERNEL | GFP_DMA);
  if (!fw_buf) {
 -sms_info(failed to allocate firmware buffer);
 +sms_err(failed to allocate firmware buffer);

It's not really related to this patch, but I think there's a memory leak
here: release_firmware() isn't called if kmalloc() above fails. I'd just add
a goto and a label to the end of the function where that's being done (and
set rc, too).

While you're at it, could you send a patch for that, please?

  return -ENOMEM;
  }
  memcpy(fw_buf, fw-data, fw-size);

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
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: [Q] Querying Y/Gb Average Level in a sensor.

2013-05-12 Thread Sakari Ailus
Hi Javier,

My apologies for the late reply.

On Mon, Jan 21, 2013 at 12:20:23PM +0100, javier Martin wrote:
 Hi,
 ov7670 and ov7675 sensors have the possibility of querying the average
 value of the Y/Cb components of the image reading a register. This
 could be useful for applications such as calise [1]. This program
 grabs frames from a video camera, calculates the average brightness
 and then adjusts screen's backlight accordingly.
 
 If the user could query the value of this register t in cameras that
 support it we could save a lot of processing effort.
 
 The first idea that came into my mind was to define a new v4l2-ctrl
 for this but I'm not sure if it is a common feature in other sensors.
 Is it worth it to define a new v4l2-ctrl for this or should I use a
 private ctrl instead?

Is this register something you can just read back from the sensor, or is it
associated to a particular frame?

In general the information sounds like such that it should be part of the
frame metadata, but I don't think the driver should read the value back from
the sensor just to provide the metadata to the user space. I could imagine
that most of the time the user space wouldn't be even interested in that at
all, but only in very specific situations. (Related to the recent frame
metadata discussion, not to your proposal.)

So I'm also leaning towards having a control for the purpose. I haven't seen
a sensor which would implement the same (anyone else?) so I'd probably start
with a private control.

Cc Hans and Laurent.

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
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: dmxdev: remove dvb_ringbuffer_flush() on writer side

2013-05-12 Thread Soeren Moch

On 10.05.2013 21:39, Sakari Ailus wrote:

Hi Soeren,

Thanks for the patch!

On Sun, Apr 14, 2013 at 11:03:42AM +0200, Soeren Moch wrote:

In dvb_ringbuffer lock-less synchronizationof reader and writer threads is done
with separateread and write pointers. Since dvb_ringbuffer_flush() modifies the
read pointer, this function must not be called from the writer thread.

This patch removes the dvb_ringbuffer_flush() calls in the dmxdev ringbuffer
write functions, this fixes Oopses Unable to handle kernel paging request
I could observe for the call chain dvb_demux_read -dvb_dmxdev_buffer_read -
dvb_ringbuffer_read_user - __copy_to_user (the reader side of the ringbuffer).

The flush calls at the write side are not necessary anyway since 
ringbuffer_flush
is also called in dvb_dmxdev_buffer_read() when an error condition is set in the
ringbuffer.

This patch should also be applied to stable kernels.

Signed-off-by: Soeren Moch sm...@web.de
CC: sta...@vger.kernel.org

While the change the patch does itself appears sound to me, I need to ask
you to resend the patch using git send-email (it won't apply as-is). I can
do that this time, too; let me know what works for you.

Please convert this patch to git format, thank you!


Reviewed-by: Sakari Ailus sakari.ai...@iki.fi

And thanks for your rewiew, too.

  Soeren



--- a/drivers/media/dvb-core/dmxdev.c   2013-04-05 21:21:15.0 +0200
+++ b/drivers/media/dvb-core/dmxdev.c   2013-04-14 09:01:58.0 +0200
@@ -377,10 +377,8 @@ static int dvb_dmxdev_section_callback(c
ret = dvb_dmxdev_buffer_write(dmxdevfilter-buffer, buffer2,
  buffer2_len);
}
-   if (ret  0) {
-   dvb_ringbuffer_flush(dmxdevfilter-buffer);
+   if (ret  0)
dmxdevfilter-buffer.error = ret;
-   }
if (dmxdevfilter-params.sec.flags  DMX_ONESHOT)
dmxdevfilter-state = DMXDEV_STATE_DONE;
spin_unlock(dmxdevfilter-dev-lock);
@@ -416,10 +414,8 @@ static int dvb_dmxdev_ts_callback(const
ret = dvb_dmxdev_buffer_write(buffer, buffer1, buffer1_len);
if (ret == buffer1_len)
ret = dvb_dmxdev_buffer_write(buffer, buffer2, buffer2_len);
-   if (ret  0) {
-   dvb_ringbuffer_flush(buffer);
+   if (ret  0)
buffer-error = ret;
-   }
spin_unlock(dmxdevfilter-dev-lock);
wake_up(buffer-queue);
return 0;



--
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


V4L read IQ data and constellation visualization added

2013-05-12 Thread Abylay Ospan
Hello,

Reading IQ data from frontend and generation PNG image was added.
Linux kernel (v4l subsystem) should be patched. DTV_READ_IQ and
.read_iq added.

Here is a description with some images obtained from real environment:
http://www.linuxtv.org/wiki/index.php/Dvb_constellation

Currently .read_iq implemented for NetUP's cards only (T/C and S2
card). Other developers can implement read_iq for another cards.

Reading IQ data and visualization tools was added into v4l-utils package.

Here is a patches:
Patch for Linux kernel: http://stand.netup.tv/downloads/iq_constellation.patch
Patch for v4l-utils:
http://stand.netup.tv/downloads/iq_constellation_v4l-utils.patch

Mauro, please apply this patches if they are ok ?

--
Abylay Ospan
--
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


Si2169 support

2013-05-12 Thread Johann Wilhelm

Hi there!

I got one of these Hauppauge HVR-930C HD. They seem not to be  
supported by the kernel so far. Is there anyone working on the Si2169  
support (afaik the demodulator is the only problem)?


If not does anyone have a programmers manual from SiLabs? The  
datasheet I found isn't worth mentioning :/


Thanks,
  Hans
--
DI Johann Wilhelm



This message was sent using IMP, the Internet Messaging Program.

--
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] smscoreapi: Make Siano firmware load more verbose

2013-05-12 Thread Roberto Alcântara
Hi Sakari,

Ok I will review code looking for memory leaks.

Thank you for the tip.

 - Roberto


On Sun, May 12, 2013 at 4:17 AM, Sakari Ailus sakari.ai...@iki.fi wrote:
 Hi Roberto,

 On Sat, May 11, 2013 at 12:53:29PM -0300, Roberto Alcântara wrote:
 Signed-off-by: Roberto Alcantara robe...@eletronica.org

 diff --git a/drivers/media/common/siano/smscoreapi.c
 b/drivers/media/common/siano/smscoreapi.c
 index 45ac9ee..dbe9b4d 100644
 --- a/drivers/media/common/siano/smscoreapi.c
 +++ b/drivers/media/common/siano/smscoreapi.c
 @@ -1154,7 +1154,7 @@ static int
 smscore_load_firmware_from_file(struct smscore_device_t *coredev,

  char *fw_filename = smscore_get_fw_filename(coredev, mode);
  if (!fw_filename) {
 -sms_info(mode %d not supported on this device, mode);
 +sms_err(mode %d not supported on this device, mode);
  return -ENOENT;
  }
  sms_debug(Firmware name: %s, fw_filename);
 @@ -1165,14 +1165,14 @@ static int
 smscore_load_firmware_from_file(struct smscore_device_t *coredev,

  rc = request_firmware(fw, fw_filename, coredev-device);
  if (rc  0) {
 -sms_info(failed to open \%s\, fw_filename);
 +sms_err(failed to open firmware file \%s\, fw_filename);
  return rc;
  }
  sms_info(read fw %s, buffer size=0x%zx, fw_filename, fw-size);
  fw_buf = kmalloc(ALIGN(fw-size, SMS_ALLOC_ALIGNMENT),
   GFP_KERNEL | GFP_DMA);
  if (!fw_buf) {
 -sms_info(failed to allocate firmware buffer);
 +sms_err(failed to allocate firmware buffer);

 It's not really related to this patch, but I think there's a memory leak
 here: release_firmware() isn't called if kmalloc() above fails. I'd just add
 a goto and a label to the end of the function where that's being done (and
 set rc, too).

 While you're at it, could you send a patch for that, please?

  return -ENOMEM;
  }
  memcpy(fw_buf, fw-data, fw-size);

 --
 Kind regards,

 Sakari Ailus
 e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
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


cron job: media_tree daily build: WARNINGS

2013-05-12 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:   Sun May 12 19:00:27 CEST 2013
git branch: test
git hash:   02615ed5e1b2283db2495af3cf8f4ee172c77d80
gcc version:i686-linux-gcc (GCC) 4.7.2
host hardware:  x86_64
host os:3.8-3.slh.2-amd64

linux-git-arm-davinci: OK
linux-git-arm-exynos: WARNINGS
linux-git-arm-omap: WARNINGS
linux-git-blackfin: WARNINGS
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.31.14-i686: WARNINGS
linux-2.6.32.27-i686: WARNINGS
linux-2.6.33.7-i686: WARNINGS
linux-2.6.34.7-i686: WARNINGS
linux-2.6.35.9-i686: WARNINGS
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: WARNINGS
linux-3.3.8-i686: WARNINGS
linux-3.4.27-i686: WARNINGS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: OK
linux-3.9-rc1-i686: OK
linux-2.6.31.14-x86_64: WARNINGS
linux-2.6.32.27-x86_64: WARNINGS
linux-2.6.33.7-x86_64: WARNINGS
linux-2.6.34.7-x86_64: WARNINGS
linux-2.6.35.9-x86_64: WARNINGS
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: WARNINGS
linux-3.3.8-x86_64: WARNINGS
linux-3.4.27-x86_64: WARNINGS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: OK
linux-3.9-rc1-x86_64: OK
apps: WARNINGS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API 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


[GIT PULL - BUG FIXES FOR 3.10] Samsung media driver fixes

2013-05-12 Thread Sylwester Nawrocki

Hi Mauro,

The following are couple bug fixes for the Samsung SoC camera and sensor
drivers.

I have included also a patch correcting the Exynos FIMC-LITE device DT
binding documentation, so as to avoid confusing any board integrators
trying to write .dts files including support for those devices. I hope
it still qualifies for 3.10, it's a fix for stuff that got first added
in this release.

Thanks,
Sylwester

The following changes since commit f722406faae2d073cc1d01063d1123c35425939e:

  Linux 3.10-rc1 (2013-05-11 17:14:08 -0700)

are available in the git repository at:
  git://linuxtv.org/snawrocki/samsung.git v3.10-fixes-1

Axel Lin (2):
  s5c73m3: Fix off-by-one valid range checking for fie-index
  exynos4-is: Fix off-by-one valid range checking for is-config_index

Sachin Kamat (2):
  exynos4-is: Fix potential null pointer dereference in mipi-csis.c
  s3c-camif: Fix incorrect variable type

Sylwester Nawrocki (1):
  exynos4-is: Correct fimc-lite compatible property description

 .../devicetree/bindings/media/exynos-fimc-lite.txt |2 +-
 drivers/media/i2c/s5c73m3/s5c73m3-core.c   |2 +-
 drivers/media/platform/exynos4-is/fimc-is-regs.c   |2 +-
 drivers/media/platform/exynos4-is/mipi-csis.c  |2 +-
 drivers/media/platform/s3c-camif/camif-core.h  |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
--
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] smscoreapi: fixing memory leak

2013-05-12 Thread Roberto Alcântara
 - Roberto


mem.patch
Description: Binary data


[PATCH RFC V4 FINAL] media: i2c: mt9p031: add OF support

2013-05-12 Thread Lad Prabhakar
From: Lad, Prabhakar prabhakar.cse...@gmail.com

add OF support for the mt9p031 sensor driver.
Alongside this patch sorts the header inclusion alphabetically.

Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
Cc: Hans Verkuil hans.verk...@cisco.com
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Mauro Carvalho Chehab mche...@redhat.com
Cc: Guennadi Liakhovetski g.liakhovet...@gmx.de
Cc: Sylwester Nawrocki s.nawro...@samsung.com
Cc: Sakari Ailus sakari.ai...@iki.fi
Cc: Grant Likely grant.lik...@secretlab.ca
Cc: Sascha Hauer s.ha...@pengutronix.de
Cc: Rob Herring rob.herr...@calxeda.com
Cc: Rob Landley r...@landley.net
Cc: Arnd Bergmann a...@arndb.de
Cc: devicetree-disc...@lists.ozlabs.org
Cc: davinci-linux-open-sou...@linux.davincidsp.com
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
---
 Changes for v4:
 1: Renamed gpio-reset property to reset-gpios.
 2: Dropped assigning the driver data from the of node.

 Changes for v3:
 1: Dropped check if gpio-reset is valid.
 2: Fixed some code nits.
 3: Included a reference to the V4L2 DT bindings documentation.

 Changes for v2:
 1: Used '-' instead of '_' for device properties.
 2: Specified gpio reset pin as phandle in device node.
 3: Handle platform data properly even if kernel is compiled with
devicetree support.
 4: Used dev_* for messages in drivers instead of pr_*.
 5: Changed compatible property to aptina,mt9p031 and aptina,mt9p031m.
 6: Sorted the header inclusion alphabetically and fixed some minor code nits.

 .../devicetree/bindings/media/i2c/mt9p031.txt  |   40 +++
 drivers/media/i2c/mt9p031.c|   42 +++-
 2 files changed, 80 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/mt9p031.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/mt9p031.txt 
b/Documentation/devicetree/bindings/media/i2c/mt9p031.txt
new file mode 100644
index 000..59d613c
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/mt9p031.txt
@@ -0,0 +1,40 @@
+* Aptina 1/2.5-Inch 5Mp CMOS Digital Image Sensor
+
+The Aptina MT9P031 is a 1/2.5-inch CMOS active pixel digital image sensor with
+an active array size of 2592H x 1944V. It is programmable through a simple
+two-wire serial interface.
+
+Required Properties :
+- compatible : value should be either one among the following
+   (a) aptina,mt9p031 for mt9p031 sensor
+   (b) aptina,mt9p031m for mt9p031m sensor
+
+- input-clock-frequency : Input clock frequency.
+
+- pixel-clock-frequency : Pixel clock frequency.
+
+Optional Properties :
+- reset-gpios: Chip reset GPIO
+
+For further reading of port node refer Documentation/devicetree/bindings/media/
+video-interfaces.txt.
+
+Example:
+
+   i2c0@1c22000 {
+   ...
+   ...
+   mt9p031@5d {
+   compatible = aptina,mt9p031;
+   reg = 0x5d;
+   reset-gpios = gpio3 30 0;
+
+   port {
+   mt9p031_1: endpoint {
+   input-clock-frequency = 600;
+   pixel-clock-frequency = 9600;
+   };
+   };
+   };
+   ...
+   };
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index 28cf95b..a58207c 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -16,9 +16,11 @@
 #include linux/delay.h
 #include linux/device.h
 #include linux/gpio.h
-#include linux/module.h
 #include linux/i2c.h
 #include linux/log2.h
+#include linux/module.h
+#include linux/of_device.h
+#include linux/of_gpio.h
 #include linux/pm.h
 #include linux/regulator/consumer.h
 #include linux/slab.h
@@ -28,6 +30,7 @@
 #include media/v4l2-chip-ident.h
 #include media/v4l2-ctrls.h
 #include media/v4l2-device.h
+#include media/v4l2-of.h
 #include media/v4l2-subdev.h
 
 #include aptina-pll.h
@@ -928,10 +931,35 @@ static const struct v4l2_subdev_internal_ops 
mt9p031_subdev_internal_ops = {
  * Driver initialization and probing
  */
 
+static struct mt9p031_platform_data *
+mt9p031_get_pdata(struct i2c_client *client)
+{
+   struct device_node *np;
+   struct mt9p031_platform_data *pdata;
+
+   if (!IS_ENABLED(CONFIG_OF) || !client-dev.of_node)
+   return client-dev.platform_data;
+
+   np = v4l2_of_get_next_endpoint(client-dev.of_node, NULL);
+   if (!np)
+   return NULL;
+
+   pdata = devm_kzalloc(client-dev, sizeof(struct mt9p031_platform_data),
+GFP_KERNEL);
+   if (!pdata)
+   return NULL;
+
+   pdata-reset = of_get_named_gpio(client-dev.of_node, reset-gpios, 0);
+   of_property_read_u32(np, input-clock-frequency, pdata-ext_freq);
+   of_property_read_u32(np, pixel-clock-frequency, pdata-target_freq);
+
+   return pdata;
+}

[PATCH] [media] v4l: vb2: fix error return code in __vb2_init_fileio()

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Fix to return -EINVAL in the get kernel address error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/media/v4l2-core/videobuf2-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
b/drivers/media/v4l2-core/videobuf2-core.c
index 7d833ee..7bd3ee6 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -2193,8 +2193,10 @@ static int __vb2_init_fileio(struct vb2_queue *q, int 
read)
 */
for (i = 0; i  q-num_buffers; i++) {
fileio-bufs[i].vaddr = vb2_plane_vaddr(q-bufs[i], 0);
-   if (fileio-bufs[i].vaddr == NULL)
+   if (fileio-bufs[i].vaddr == NULL) {
+   ret = -EINVAL;
goto err_reqbufs;
+   }
fileio-bufs[i].size = vb2_plane_size(q-bufs[i], 0);
}
 

--
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] s5p-tv: fix error return code in mxr_acquire_video()

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Fix to return a negative error code in the vb2_dma_contig_init_ctx()
error handling case instead of 0, as done elsewhere in this function.
Also vb2_dma_contig_init_ctx() return ERR_PTR() in case of error and
never return NULL, so use IS_ERR() replace IS_ERR_OR_NULL().

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/media/platform/s5p-tv/mixer_video.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/s5p-tv/mixer_video.c 
b/drivers/media/platform/s5p-tv/mixer_video.c
index ef0efdf..641b1f0 100644
--- a/drivers/media/platform/s5p-tv/mixer_video.c
+++ b/drivers/media/platform/s5p-tv/mixer_video.c
@@ -81,8 +81,9 @@ int mxr_acquire_video(struct mxr_device *mdev,
}
 
mdev-alloc_ctx = vb2_dma_contig_init_ctx(mdev-dev);
-   if (IS_ERR_OR_NULL(mdev-alloc_ctx)) {
+   if (IS_ERR(mdev-alloc_ctx)) {
mxr_err(mdev, could not acquire vb2 allocator\n);
+   ret = PTR_ERR(mdev-alloc_ctx);
goto fail_v4l2_dev;
}
 

--
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] vpif_display: fix error return code in vpif_probe()

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Fix to return -ENODEV in the subdevice register error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/media/platform/davinci/vpif_display.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/davinci/vpif_display.c 
b/drivers/media/platform/davinci/vpif_display.c
index 1b3fb5c..50b2f39 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1813,6 +1813,7 @@ static __init int vpif_probe(struct platform_device *pdev)
NULL);
if (!vpif_obj.sd[i]) {
vpif_err(Error registering v4l2 subdevice\n);
+   err = -ENODEV;
goto probe_subdev_out;
}
 

--
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] vpif_capture: fix error return code in vpif_probe()

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Fix to return -ENODEV in the subdevice register error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/media/platform/davinci/vpif_capture.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index 5f98df1..ef0fc94 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -2170,6 +2170,7 @@ static __init int vpif_probe(struct platform_device *pdev)
 
if (!vpif_obj.sd[i]) {
vpif_err(Error registering v4l2 subdevice\n);
+   err = -ENODEV;
goto probe_subdev_out;
}
v4l2_info(vpif_obj.v4l2_dev, registered sub device %s\n,

--
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] blackfin: fix error return code in bcap_probe()

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/media/platform/blackfin/bfin_capture.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/blackfin/bfin_capture.c 
b/drivers/media/platform/blackfin/bfin_capture.c
index 0e55b08..2d1e032 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -1070,6 +1070,7 @@ static int bcap_probe(struct platform_device *pdev)
if (!config-num_inputs) {
v4l2_err(bcap_dev-v4l2_dev,
Unable to work without input\n);
+   ret = -EINVAL;
goto err_unreg_vdev;
}
 
@@ -1079,6 +1080,7 @@ static int bcap_probe(struct platform_device *pdev)
} else {
v4l2_err(bcap_dev-v4l2_dev,
Unable to register sub device\n);
+   ret = -ENODEV;
goto err_unreg_vdev;
}
 

--
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] sta2x11_vip: fix error return code in sta2x11_vip_init_one()

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/media/pci/sta2x11/sta2x11_vip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c 
b/drivers/media/pci/sta2x11/sta2x11_vip.c
index 7005695..77edc11 100644
--- a/drivers/media/pci/sta2x11/sta2x11_vip.c
+++ b/drivers/media/pci/sta2x11/sta2x11_vip.c
@@ -1047,7 +1047,8 @@ static int sta2x11_vip_init_one(struct pci_dev *pdev,
ret = sta2x11_vip_init_controls(vip);
if (ret)
goto free_mem;
-   if (v4l2_device_register(pdev-dev, vip-v4l2_dev))
+   ret = v4l2_device_register(pdev-dev, vip-v4l2_dev);
+   if (ret)
goto free_mem;
 
dev_dbg(pdev-dev, BAR #0 at 0x%lx 0x%lx irq %d\n,

--
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