[PATCH -next] media: vimc: Fix error return code in vimc_register_devices()

2019-10-08 Thread Wei Yongjun
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: f13d5f361959 ("media: vimc: Collapse component structure into a single 
monolithic driver")
Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/vimc/vimc-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/vimc/vimc-core.c 
b/drivers/media/platform/vimc/vimc-core.c
index 6e3e5c91ae39..2d20a7c10398 100644
--- a/drivers/media/platform/vimc/vimc-core.c
+++ b/drivers/media/platform/vimc/vimc-core.c
@@ -202,8 +202,10 @@ static int vimc_register_devices(struct vimc_device *vimc)
vimc->ent_devs = kmalloc_array(vimc->pipe_cfg->num_ents,
   sizeof(*vimc->ent_devs),
   GFP_KERNEL);
-   if (!vimc->ent_devs)
+   if (!vimc->ent_devs) {
+   ret = -ENOMEM;
goto err_v4l2_unregister;
+   }
 
/* Invoke entity config hooks to initialize and register subdevs */
ret = vimc_add_subdevs(vimc);





[PATCH -next] media: platform: Fix missing spin_lock_init()

2018-12-17 Thread Wei Yongjun
The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver")
Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/aspeed-video.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/aspeed-video.c 
b/drivers/media/platform/aspeed-video.c
index dfec813..692e08e 100644
--- a/drivers/media/platform/aspeed-video.c
+++ b/drivers/media/platform/aspeed-video.c
@@ -1661,6 +1661,7 @@ static int aspeed_video_probe(struct platform_device 
*pdev)
 
video->frame_rate = 30;
video->dev = &pdev->dev;
+   spin_lock_init(&video->lock);
mutex_init(&video->video_lock);
init_waitqueue_head(&video->wait);
INIT_DELAYED_WORK(&video->res_work, aspeed_video_resolution_work);





[PATCH -next] media: tvp5150: make function tvp5150_volatile_reg() static

2018-08-01 Thread Wei Yongjun
Fixes the following sparse warning:

drivers/media/i2c/tvp5150.c:1457:6: warning:
 symbol 'tvp5150_volatile_reg' was not declared. Should it be static?

Signed-off-by: Wei Yongjun 
---
 drivers/media/i2c/tvp5150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 7b0d42b..ad3b728 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -1454,7 +1454,7 @@ static int tvp5150_registered(struct v4l2_subdev *sd)
},
 };
 
-bool tvp5150_volatile_reg(struct device *dev, unsigned int reg)
+static bool tvp5150_volatile_reg(struct device *dev, unsigned int reg)
 {
switch (reg) {
case TVP5150_VERT_LN_COUNT_MSB:



[PATCH -next] media: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels()

2018-01-17 Thread Wei Yongjun
Fix to return error code -ENODEV from the dma_request_slave_channel()
error handling case instead of 0, as done elsewhere in this function.
rc can be overwrite to 0 by dmaengine_slave_config() in the for loop.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/rcar_drif.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/rcar_drif.c 
b/drivers/media/platform/rcar_drif.c
index b2e080e..dc7e280 100644
--- a/drivers/media/platform/rcar_drif.c
+++ b/drivers/media/platform/rcar_drif.c
@@ -274,7 +274,7 @@ static int rcar_drif_alloc_dmachannels(struct rcar_drif_sdr 
*sdr)
 {
struct dma_slave_config dma_cfg;
unsigned int i;
-   int ret = -ENODEV;
+   int ret;
 
for_each_rcar_drif_channel(i, &sdr->cur_ch_mask) {
struct rcar_drif *ch = sdr->ch[i];
@@ -282,6 +282,7 @@ static int rcar_drif_alloc_dmachannels(struct rcar_drif_sdr 
*sdr)
ch->dmach = dma_request_slave_channel(&ch->pdev->dev, "rx");
if (!ch->dmach) {
rdrif_err(sdr, "ch%u: dma channel req failed\n", i);
+   ret = -ENODEV;
goto dmach_error;
}



[PATCH -next] media: atmel-isc: Make local symbol fmt_configs_list static

2017-12-22 Thread Wei Yongjun
Fixes the following sparse warning:

drivers/media/platform/atmel/atmel-isc.c:338:19: warning:
 symbol 'fmt_configs_list' was not declared. Should it be static?

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/atmel/atmel-isc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/atmel/atmel-isc.c 
b/drivers/media/platform/atmel/atmel-isc.c
index 0c26356..2dd72fc 100644
--- a/drivers/media/platform/atmel/atmel-isc.c
+++ b/drivers/media/platform/atmel/atmel-isc.c
@@ -335,7 +335,7 @@ struct isc_device {
},
 };
 
-struct fmt_config fmt_configs_list[] = {
+static struct fmt_config fmt_configs_list[] = {
{
.fourcc = V4L2_PIX_FMT_SBGGR8,
.pfe_cfg0_bps   = ISC_PFE_CFG0_BPS_EIGHT,



[PATCH] [media] vimc: Fix return value check in vimc_add_subdevs()

2017-10-11 Thread Wei Yongjun
In case of error, the function platform_device_register_data() returns
ERR_PTR() and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/vimc/vimc-core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/vimc/vimc-core.c 
b/drivers/media/platform/vimc/vimc-core.c
index 51c0eee..fe088a9 100644
--- a/drivers/media/platform/vimc/vimc-core.c
+++ b/drivers/media/platform/vimc/vimc-core.c
@@ -267,11 +267,12 @@ static struct component_match *vimc_add_subdevs(struct 
vimc_device *vimc)
PLATFORM_DEVID_AUTO,
&pdata,
sizeof(pdata));
-   if (!vimc->subdevs[i]) {
+   if (IS_ERR(vimc->subdevs[i])) {
+   match = ERR_CAST(vimc->subdevs[i]);
while (--i >= 0)
platform_device_unregister(vimc->subdevs[i]);
 
-   return ERR_PTR(-ENOMEM);
+   return match;
}
 
component_match_add(&vimc->pdev.dev, &match, vimc_comp_compare,





[PATCH -next] [media] s5p-cec: remove unused including

2017-04-25 Thread Wei Yongjun
From: Wei Yongjun 

Remove including  that is not needed.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/s5p-cec/s5p_cec.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/s5p-cec/s5p_cec.h 
b/drivers/media/platform/s5p-cec/s5p_cec.h
index 7015845..8bcd8dc 100644
--- a/drivers/media/platform/s5p-cec/s5p_cec.h
+++ b/drivers/media/platform/s5p-cec/s5p_cec.h
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 





[PATCH -next] [media] rainshadow-cec: Fix missing spin_lock_init()

2017-04-24 Thread Wei Yongjun
From: Wei Yongjun 

The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

Fixes: 0f314f6c2e77 ("[media] rainshadow-cec: new RainShadow Tech HDMI
CEC driver")
Signed-off-by: Wei Yongjun 
---
 drivers/media/usb/rainshadow-cec/rainshadow-cec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c 
b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c
index 541ca54..8f562ed 100644
--- a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c
+++ b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c
@@ -336,6 +336,7 @@ static int rain_connect(struct serio *serio, struct 
serio_driver *drv)
serio_set_drvdata(serio, rain);
INIT_WORK(&rain->work, rain_irq_work_handler);
mutex_init(&rain->write_lock);
+   spin_lock_init(&rain->buf_lock);
 
err = serio_open(serio, drv);
if (err)



[PATCH -next] [media] mtk-vcodec: remove redundant return value check of platform_get_resource()

2017-02-07 Thread Wei Yongjun
From: Wei Yongjun 

Remove unneeded error handling on the result of a call
to platform_get_resource() when the value is passed to
devm_ioremap_resource().

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
index aa81f3c..83f859e 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
@@ -269,11 +269,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
 
for (i = VENC_SYS, j = 0; i < NUM_MAX_VCODEC_REG_BASE; i++, j++) {
res = platform_get_resource(pdev, IORESOURCE_MEM, j);
-   if (res == NULL) {
-   dev_err(&pdev->dev, "get memory resource failed.");
-   ret = -ENXIO;
-   goto err_res;
-   }
dev->reg_base[i] = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR((__force void *)dev->reg_base[i])) {
ret = PTR_ERR((__force void *)dev->reg_base[i]);



--
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 -next] gp8psk: make local symbol gp8psk_fe_ops static

2017-01-12 Thread Wei Yongjun
From: Wei Yongjun 

Fixes the following sparse warning:

drivers/media/usb/dvb-usb/gp8psk.c:281:28: warning:
 symbol 'gp8psk_fe_ops' was not declared. Should it be static?

Signed-off-by: Wei Yongjun 
---
 drivers/media/usb/dvb-usb/gp8psk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb/gp8psk.c 
b/drivers/media/usb/dvb-usb/gp8psk.c
index 2360e7e..7dc3bdd 100644
--- a/drivers/media/usb/dvb-usb/gp8psk.c
+++ b/drivers/media/usb/dvb-usb/gp8psk.c
@@ -278,7 +278,7 @@ static int gp8psk_fe_reload(void *priv)
return gp8psk_bcm4500_reload(d);
 }
 
-const struct gp8psk_fe_ops gp8psk_fe_ops = {
+static const struct gp8psk_fe_ops gp8psk_fe_ops = {
.in = gp8psk_fe_in,
.out = gp8psk_fe_out,
.reload = gp8psk_fe_reload,

--
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 -next] [media] media: usb: tm6000: fix typo in parameter description

2017-01-12 Thread Wei Yongjun
From: Wei Yongjun 

Fix typo in parameter description.

Signed-off-by: Wei Yongjun 
---
 drivers/media/usb/tm6000/tm6000-input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/tm6000/tm6000-input.c 
b/drivers/media/usb/tm6000/tm6000-input.c
index 7fe00a5..6856674 100644
--- a/drivers/media/usb/tm6000/tm6000-input.c
+++ b/drivers/media/usb/tm6000/tm6000-input.c
@@ -39,7 +39,7 @@ MODULE_PARM_DESC(enable_ir, "enable ir (default is enable)");
 
 static unsigned int ir_clock_mhz = 12;
 module_param(ir_clock_mhz, int, 0644);
-MODULE_PARM_DESC(enable_ir, "ir clock, in MHz");
+MODULE_PARM_DESC(ir_clock_mhz, "ir clock, in MHz");
 
 #define URB_SUBMIT_DELAY   100 /* ms - Delay to submit an URB request 
on retrial and init */
 #define URB_INT_LED_DELAY  100 /* ms - Delay to turn led on again on 
int mode */

--
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 -next] [media] atmel-isc: fix error return code in atmel_isc_probe()

2016-11-11 Thread Wei Yongjun
From: Wei Yongjun 

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

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/atmel/atmel-isc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/atmel/atmel-isc.c 
b/drivers/media/platform/atmel/atmel-isc.c
index 8e25d3f..fa68fe9 100644
--- a/drivers/media/platform/atmel/atmel-isc.c
+++ b/drivers/media/platform/atmel/atmel-isc.c
@@ -1424,6 +1424,7 @@ static int atmel_isc_probe(struct platform_device *pdev)
 
if (list_empty(&isc->subdev_entities)) {
dev_err(dev, "no subdev found\n");
+   ret = -ENODEV;
goto unregister_v4l2_device;
}

--
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 -next] [media] c8sectpfe: fix error return code in c8sectpfe_probe()

2016-10-29 Thread Wei Yongjun
From: Wei Yongjun 

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

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c 
b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
index 42b123f..69d9a16 100644
--- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
+++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
@@ -813,6 +813,7 @@ static int c8sectpfe_probe(struct platform_device *pdev)
i2c_bus = of_parse_phandle(child, "i2c-bus", 0);
if (!i2c_bus) {
dev_err(&pdev->dev, "No i2c-bus found\n");
+   ret = -ENODEV;
goto err_clk_disable;
}
tsin->i2c_adapter =
@@ -820,6 +821,7 @@ static int c8sectpfe_probe(struct platform_device *pdev)
if (!tsin->i2c_adapter) {
dev_err(&pdev->dev, "No i2c adapter found\n");
of_node_put(i2c_bus);
+   ret = -ENODEV;
goto err_clk_disable;
}
of_node_put(i2c_bus);

--
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 -next] [media] dibusb: fix possible memory leak in dibusb_rc_query()

2016-10-29 Thread Wei Yongjun
From: Wei Yongjun 

'buf' is malloced in dibusb_rc_query() and should be freed before
leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: ff1c123545d7 ("[media] dibusb: handle error code on RC query")
Signed-off-by: Wei Yongjun 
---
 drivers/media/usb/dvb-usb/dibusb-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb/dibusb-common.c 
b/drivers/media/usb/dvb-usb/dibusb-common.c
index de3ee25..8207e69 100644
--- a/drivers/media/usb/dvb-usb/dibusb-common.c
+++ b/drivers/media/usb/dvb-usb/dibusb-common.c
@@ -382,9 +382,9 @@ int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, 
int *state)
if (buf[0] != 0)
deb_info("key: %*ph\n", 5, buf);
 
+ret:
kfree(buf);
 
-ret:
return ret;
 }
 EXPORT_SYMBOL(dibusb_rc_query);

--
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 -next] [media] dibusb: fix possible memory leak in dibusb_rc_query()

2016-10-29 Thread Wei Yongjun
From: Wei Yongjun 

'buf' is malloced in dibusb_rc_query() and should be freed before
leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: ff1c123545d7 ("[media] dibusb: handle error code on RC query")
Signed-off-by: Wei Yongjun 
---
 drivers/media/usb/dvb-usb/dibusb-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb/dibusb-common.c 
b/drivers/media/usb/dvb-usb/dibusb-common.c
index de3ee25..8207e69 100644
--- a/drivers/media/usb/dvb-usb/dibusb-common.c
+++ b/drivers/media/usb/dvb-usb/dibusb-common.c
@@ -382,9 +382,9 @@ int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, 
int *state)
if (buf[0] != 0)
deb_info("key: %*ph\n", 5, buf);
 
+ret:
kfree(buf);
 
-ret:
return ret;
 }
 EXPORT_SYMBOL(dibusb_rc_query);

--
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 -next] dma-buf/sw_sync: fix non static symbol warning

2016-10-29 Thread Wei Yongjun
From: Wei Yongjun 

Fixes the following sparse warning:

drivers/dma-buf/sw_sync.c:87:22: warning:
 symbol 'sync_timeline_create' was not declared. Should it be static?

Signed-off-by: Wei Yongjun 
---
 drivers/dma-buf/sw_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index 82e0ca4..7aa4d7b 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -84,7 +84,7 @@ static inline struct sync_pt *dma_fence_to_sync_pt(struct 
dma_fence *fence)
  * Creates a new sync_timeline. Returns the sync_timeline object or NULL in
  * case of error.
  */
-struct sync_timeline *sync_timeline_create(const char *name)
+static struct sync_timeline *sync_timeline_create(const char *name)
 {
struct sync_timeline *obj;

--
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 -next] [media] s5p-cec: remove unused including

2016-10-29 Thread Wei Yongjun
From: Wei Yongjun 

Remove including  that don't need it.

Signed-off-by: Wei Yongjun 
---
 drivers/staging/media/s5p-cec/s5p_cec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c 
b/drivers/staging/media/s5p-cec/s5p_cec.c
index 1780a08..aef962b 100644
--- a/drivers/staging/media/s5p-cec/s5p_cec.c
+++ b/drivers/staging/media/s5p-cec/s5p_cec.c
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 

--
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 -next] staging: media: stih-cec: remove unused including

2016-09-28 Thread Wei Yongjun
From: Wei Yongjun 

Remove including  that don't need it.

Signed-off-by: Wei Yongjun 
---
 drivers/staging/media/st-cec/stih-cec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/st-cec/stih-cec.c 
b/drivers/staging/media/st-cec/stih-cec.c
index 2143448..b0aee1d 100644
--- a/drivers/staging/media/st-cec/stih-cec.c
+++ b/drivers/staging/media/st-cec/stih-cec.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 

--
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 -next] [media] cx88: fix error return code in cx8802_dvb_probe()

2016-09-21 Thread Wei Yongjun
From: Wei Yongjun 

Fix to return error code -ENODEV from the error handling case
instead of 0(err maybe overwrited to 0 in the for loop), as
done elsewhere in this function.

Signed-off-by: Wei Yongjun 
---
 drivers/media/pci/cx88/cx88-dvb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/pci/cx88/cx88-dvb.c 
b/drivers/media/pci/cx88/cx88-dvb.c
index ac2392d..d76a175 100644
--- a/drivers/media/pci/cx88/cx88-dvb.c
+++ b/drivers/media/pci/cx88/cx88-dvb.c
@@ -1779,6 +1779,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
if (fe == NULL) {
printk(KERN_ERR "%s() failed to get frontend(%d)\n",
__func__, i);
+   err = -ENODEV;
goto fail_probe;
}
q = &fe->dvb.dvbq;

--
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 -next] [media] bdisp: fix error return code in bdisp_probe()

2016-09-21 Thread Wei Yongjun
From: Wei Yongjun 

Fix to return error code -EINVAL from the platform_get_resource() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c 
b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
index 45f82b5..8236081 100644
--- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
+++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
@@ -1337,6 +1337,7 @@ static int bdisp_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res) {
dev_err(dev, "failed to get IRQ resource\n");
+   ret = -EINVAL;
goto err_clk;
}

--
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 -next] [media] gs1662: remove .owner field for driver

2016-09-21 Thread Wei Yongjun
From: Wei Yongjun 

Remove .owner field if calls are used which set it automatically.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Wei Yongjun 
---
 drivers/media/spi/gs1662.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/spi/gs1662.c b/drivers/media/spi/gs1662.c
index d76f362..057530b 100644
--- a/drivers/media/spi/gs1662.c
+++ b/drivers/media/spi/gs1662.c
@@ -463,7 +463,6 @@ static int gs_remove(struct spi_device *spi)
 static struct spi_driver gs_driver = {
.driver = {
.name   = "gs1662",
-   .owner  = THIS_MODULE,
},
 
.probe  = gs_probe,



--
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 -next] [media] gs1662: drop kfree for memory allocated with devm_kzalloc

2016-09-21 Thread Wei Yongjun
From: Wei Yongjun 

It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Fixes: 7aae6e2df127 ("[media] Add GS1662 driver, a video serializer")
Signed-off-by: Wei Yongjun 
---
 drivers/media/spi/gs1662.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/spi/gs1662.c b/drivers/media/spi/gs1662.c
index d76f362..5143a90 100644
--- a/drivers/media/spi/gs1662.c
+++ b/drivers/media/spi/gs1662.c
@@ -453,10 +453,9 @@ static int gs_probe(struct spi_device *spi)
 static int gs_remove(struct spi_device *spi)
 {
struct v4l2_subdev *sd = spi_get_drvdata(spi);
-   struct gs *gs = to_gs(sd);
 
v4l2_device_unregister_subdev(sd);
-   kfree(gs);
+
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


[PATCH -next] [media] vivid: fix error return code in vivid_create_instance()

2016-09-14 Thread Wei Yongjun
From: Wei Yongjun 

Fix to return error code -ENOMEM from the memory or workqueue alloc
error handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/vivid/vivid-core.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/vivid/vivid-core.c 
b/drivers/media/platform/vivid/vivid-core.c
index 741460a..5464fef 100644
--- a/drivers/media/platform/vivid/vivid-core.c
+++ b/drivers/media/platform/vivid/vivid-core.c
@@ -839,6 +839,7 @@ static int vivid_create_instance(struct platform_device 
*pdev, int inst)
dev->radio_tx_caps = V4L2_CAP_RDS_OUTPUT | V4L2_CAP_MODULATOR |
 V4L2_CAP_READWRITE;
 
+   ret = -ENOMEM;
/* initialize the test pattern generator */
tpg_init(&dev->tpg, 640, 360);
if (tpg_alloc(&dev->tpg, MAX_ZOOM * MAX_WIDTH))
@@ -1033,8 +1034,10 @@ static int vivid_create_instance(struct platform_device 
*pdev, int inst)
 */
dev->cec_workqueue =
alloc_ordered_workqueue("vivid-%03d-cec", WQ_MEM_RECLAIM, inst);
-   if (!dev->cec_workqueue)
+   if (!dev->cec_workqueue) {
+   ret = -ENOMEM;
goto unreg_dev;
+   }
 
/* start creating the vb2 queues */
if (dev->has_vid_cap) {

--
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 -next] [media] pxa_camera: remove duplicated include from pxa_camera.c

2016-09-14 Thread Wei Yongjun
From: Wei Yongjun 

Remove duplicated include.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/pxa_camera.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/pxa_camera.c 
b/drivers/media/platform/pxa_camera.c
index 1bce7eb..2d68b80 100644
--- a/drivers/media/platform/pxa_camera.c
+++ b/drivers/media/platform/pxa_camera.c
@@ -26,7 +26,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



--
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 -next] [media] pxa_camera: fix error return code in pxa_camera_probe()

2016-09-14 Thread Wei Yongjun
From: Wei Yongjun 

Fix to return error code -ENODEV from dma_request_slave_channel_compat()
error handling case instead of 0, as done elsewhere in this function.

Also fix to release resources in v4l2_clk_register() error handling.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/pxa_camera.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/pxa_camera.c 
b/drivers/media/platform/pxa_camera.c
index 1bce7eb..8035290 100644
--- a/drivers/media/platform/pxa_camera.c
+++ b/drivers/media/platform/pxa_camera.c
@@ -2402,6 +2402,7 @@ static int pxa_camera_probe(struct platform_device *pdev)
 ¶ms, &pdev->dev, "CI_U");
if (!pcdev->dma_chans[1]) {
dev_err(&pdev->dev, "Can't request DMA for Y\n");
+   err = -ENODEV;
goto exit_free_dma_y;
}
 
@@ -2411,6 +2412,7 @@ static int pxa_camera_probe(struct platform_device *pdev)
 ¶ms, &pdev->dev, "CI_V");
if (!pcdev->dma_chans[2]) {
dev_err(&pdev->dev, "Can't request DMA for V\n");
+   err = -ENODEV;
goto exit_free_dma_u;
}
 
@@ -2461,8 +2463,10 @@ static int pxa_camera_probe(struct platform_device *pdev)
 
pcdev->mclk_clk = v4l2_clk_register(&pxa_camera_mclk_ops,
clk_name, NULL);
-   if (IS_ERR(pcdev->mclk_clk))
-   return PTR_ERR(pcdev->mclk_clk);
+   if (IS_ERR(pcdev->mclk_clk)) {
+   err = PTR_ERR(pcdev->mclk_clk);
+   goto exit_free_v4l2dev;
+   }
}
 
err = v4l2_async_notifier_register(&pcdev->v4l2_dev, &pcdev->notifier);

--
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 -next] [media] adv7511: fix error return code in adv7511_probe()

2016-08-04 Thread Wei Yongjun
Fix to return error code -ENOMEM from the i2c client register error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun 
---
 drivers/media/i2c/adv7511.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c
index 53030d6..5ba0f21 100644
--- a/drivers/media/i2c/adv7511.c
+++ b/drivers/media/i2c/adv7511.c
@@ -1898,6 +1898,7 @@ static int adv7511_probe(struct i2c_client *client, const 
struct i2c_device_id *
   state->i2c_cec_addr >> 1);
if (state->i2c_cec == NULL) {
v4l2_err(sd, "failed to register cec i2c client\n");
+   err = -ENOMEM;
goto err_unreg_edid;
}
adv7511_wr(sd, 0xe2, 0x00); /* power up cec section */

--
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 -next] [media] staging: media: lirc: add missing platform_device_del() on error in lirc_parallel_init()

2016-07-19 Thread Wei Yongjun
From: Wei Yongjun 

Add the missing platform_device_del() before return from
lirc_parallel_init() in the error handling case.

Signed-off-by: Wei Yongjun 
---
 drivers/staging/media/lirc/lirc_parallel.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_parallel.c 
b/drivers/staging/media/lirc/lirc_parallel.c
index 3906ac6..878fdea 100644
--- a/drivers/staging/media/lirc/lirc_parallel.c
+++ b/drivers/staging/media/lirc/lirc_parallel.c
@@ -650,7 +650,7 @@ static int __init lirc_parallel_init(void)
if (!pport) {
pr_notice("no port at %x found\n", io);
result = -ENXIO;
-   goto exit_device_put;
+   goto exit_device_del;
}
ppdevice = parport_register_device(pport, LIRC_DRIVER_NAME,
   pf, kf, lirc_lirc_irq_handler, 0,
@@ -659,7 +659,7 @@ static int __init lirc_parallel_init(void)
if (!ppdevice) {
pr_notice("parport_register_device() failed\n");
result = -ENXIO;
-   goto exit_device_put;
+   goto exit_device_del;
}
if (parport_claim(ppdevice) != 0)
goto skip_init;
@@ -678,7 +678,7 @@ static int __init lirc_parallel_init(void)
parport_release(pport);
parport_unregister_device(ppdevice);
result = -EIO;
-   goto exit_device_put;
+   goto exit_device_del;
}
 
 #endif
@@ -695,11 +695,13 @@ static int __init lirc_parallel_init(void)
pr_notice("register_chrdev() failed\n");
parport_unregister_device(ppdevice);
result = -EIO;
-   goto exit_device_put;
+   goto exit_device_del;
}
pr_info("installed using port 0x%04x irq %d\n", io, irq);
return 0;
 
+exit_device_del:
+   platform_device_del(lirc_parallel_dev);
 exit_device_put:
platform_device_put(lirc_parallel_dev);
 exit_driver_unregister:




--
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 -next] [media] em28xx-audio: remove needless check before usb_free_coherent()

2014-01-14 Thread Wei Yongjun
From: Wei Yongjun 

usb_free_coherent() is safe with NULL addr and this check is
not required.

Signed-off-by: Wei Yongjun 
---
 drivers/media/usb/em28xx/em28xx-audio.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/media/usb/em28xx/em28xx-audio.c 
b/drivers/media/usb/em28xx/em28xx-audio.c
index f3e3200..287ce17 100644
--- a/drivers/media/usb/em28xx/em28xx-audio.c
+++ b/drivers/media/usb/em28xx/em28xx-audio.c
@@ -695,11 +695,9 @@ static void em28xx_audio_free_urb(struct em28xx *dev)
if (!urb)
continue;
 
-   if (dev->adev.transfer_buffer[i])
-   usb_free_coherent(dev->udev,
- urb->transfer_buffer_length,
- dev->adev.transfer_buffer[i],
- urb->transfer_dma);
+   usb_free_coherent(dev->udev, urb->transfer_buffer_length,
+ dev->adev.transfer_buffer[i],
+ urb->transfer_dma);
 
usb_free_urb(urb);
}

--
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 -next] [media] au0828: Fix sparse non static symbol warning

2014-01-14 Thread Wei Yongjun
From: Wei Yongjun 

Fixes the following sparse warning:

drivers/media/usb/au0828/au0828-dvb.c:36:5: warning:
 symbol 'preallocate_big_buffers' was not declared. Should it be static?

Signed-off-by: Wei Yongjun 
---
 drivers/media/usb/au0828/au0828-dvb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/au0828/au0828-dvb.c 
b/drivers/media/usb/au0828/au0828-dvb.c
index 19fe049..4ae8b10 100644
--- a/drivers/media/usb/au0828/au0828-dvb.c
+++ b/drivers/media/usb/au0828/au0828-dvb.c
@@ -33,7 +33,7 @@
 #include "mxl5007t.h"
 #include "tda18271.h"
 
-int preallocate_big_buffers;
+static int preallocate_big_buffers;
 module_param_named(preallocate_big_buffers, preallocate_big_buffers, int, 
0644);
 MODULE_PARM_DESC(preallocate_big_buffers, "Preallocate the larger transfer 
buffers at module load time");
 

--
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 -next] [media] radio-usb-si4713: fix sparse non static symbol warnings

2014-01-14 Thread Wei Yongjun
From: Wei Yongjun 

Fixes the following sparse warnings:

drivers/media/radio/si4713/radio-usb-si4713.c:226:31: warning:
 symbol 'start_seq' was not declared. Should it be static?
drivers/media/radio/si4713/radio-usb-si4713.c:291:29: warning:
 symbol 'command_table' was not declared. Should it be static?

Signed-off-by: Wei Yongjun 
---
 drivers/media/radio/si4713/radio-usb-si4713.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c 
b/drivers/media/radio/si4713/radio-usb-si4713.c
index f1e640d..779855b 100644
--- a/drivers/media/radio/si4713/radio-usb-si4713.c
+++ b/drivers/media/radio/si4713/radio-usb-si4713.c
@@ -223,7 +223,7 @@ struct si4713_start_seq_table {
  * (0x03): Get serial number of the board (Response : CB000-00-00)
  * (0x06, 0x03, 0x03, 0x08, 0x01, 0x0f) : Get Component revision
  */
-struct si4713_start_seq_table start_seq[] = {
+static struct si4713_start_seq_table start_seq[] = {
 
{ 1, { 0x03 } },
{ 2, { 0x32, 0x7f } },
@@ -288,7 +288,7 @@ struct si4713_command_table {
  * Byte 4 : Number of arguments + 1 (for the command byte)
  * Byte 5 : Number of response bytes
  */
-struct si4713_command_table command_table[] = {
+static struct si4713_command_table command_table[] = {
 
{ SI4713_CMD_POWER_UP,  { 0x00, SI4713_PWUP_NARGS + 1, 
SI4713_PWUP_NRESP} },
{ SI4713_CMD_GET_REV,   { 0x03, 0x01, SI4713_GETREV_NRESP } },

--
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 -next] [media] radio-bcm2048: fix missing unlock on error in bcm2048_rds_fifo_receive()

2013-12-11 Thread Wei Yongjun
From: Wei Yongjun 

Add the missing unlock before return from function bcm2048_rds_fifo_receive()
in the error handling case.

Signed-off-by: Wei Yongjun 
---
 drivers/staging/media/bcm2048/radio-bcm2048.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c 
b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 494ec39..37ff899 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -1767,6 +1767,7 @@ static void bcm2048_rds_fifo_receive(struct 
bcm2048_device *bdev)
bdev->rds_info.radio_text, bdev->fifo_size);
if (err != 2) {
dev_err(&bdev->client->dev, "RDS Read problem\n");
+   mutex_unlock(&bdev->mutex);
return;
}
 

--
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] cx88: use correct pci drvdata type in cx88_audio_finidev()

2013-11-20 Thread Wei Yongjun
From: Wei Yongjun 

We had set the pci drvdata in cx88_audio_initdev() as a type of
struct snd_card, so cx88_audio_finidev() should used it as the
same type too.

Signed-off-by: Wei Yongjun 
---
 drivers/media/pci/cx88/cx88-alsa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/pci/cx88/cx88-alsa.c 
b/drivers/media/pci/cx88/cx88-alsa.c
index 400eb1c..d014206e 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -931,9 +931,9 @@ error:
  */
 static void cx88_audio_finidev(struct pci_dev *pci)
 {
-   struct cx88_audio_dev *card = pci_get_drvdata(pci);
+   struct snd_card *card = pci_get_drvdata(pci);
 
-   snd_card_free((void *)card);
+   snd_card_free(card);
 
devno--;
 }

--
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 -next] [media] media: i2c: lm3560: use correct clientdata in lm3560_remove()

2013-11-08 Thread Wei Yongjun
From: Wei Yongjun 

We had set the i2c clientdata to &flash->subdev_led[LM3560_LED1]
after call lm3560_subdev_init(flash, LM3560_LED1, "lm3560-led1"),
but the container_of() in lm3560_remove() return the wrong pointer
to flash.(should be container_of(subdev, struct lm3560_flash,
subdev_led[LM3560_LED_MAX-1])
This patch fix to set i2c clientdata to flash so we can get flash
from clientdata directly.

Signed-off-by: Wei Yongjun 
---
 drivers/media/i2c/lm3560.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c
index 3317a9a..5a70d71 100644
--- a/drivers/media/i2c/lm3560.c
+++ b/drivers/media/i2c/lm3560.c
@@ -444,14 +444,14 @@ static int lm3560_probe(struct i2c_client *client,
if (rval < 0)
return rval;
 
+   i2c_set_clientdata(client, flash);
+
return 0;
 }
 
 static int lm3560_remove(struct i2c_client *client)
 {
-   struct v4l2_subdev *subdev = i2c_get_clientdata(client);
-   struct lm3560_flash *flash = container_of(subdev, struct lm3560_flash,
- subdev_led[LM3560_LED_MAX]);
+   struct lm3560_flash *flash = i2c_get_clientdata(client);
unsigned int i;
 
for (i = LM3560_LED0; i < LM3560_LED_MAX; i++) {

--
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 -next] [media] media: i2c: lm3560: fix missing unlock on error in lm3560_set_ctrl()

2013-11-07 Thread Wei Yongjun
From: Wei Yongjun 

Add the missing unlock before return from function lm3560_set_ctrl()
in the error handling case.

Signed-off-by: Wei Yongjun 
---
 drivers/media/i2c/lm3560.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c
index 3317a9a..33a6d2a 100644
--- a/drivers/media/i2c/lm3560.c
+++ b/drivers/media/i2c/lm3560.c
@@ -219,15 +219,19 @@ static int lm3560_set_ctrl(struct v4l2_ctrl *ctrl, enum 
lm3560_led_id led_no)
break;
 
case V4L2_CID_FLASH_STROBE:
-   if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH)
-   return -EBUSY;
+   if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH) {
+   rval = -EBUSY;
+   goto err_out;
+   }
flash->led_mode = V4L2_FLASH_LED_MODE_FLASH;
rval = lm3560_mode_ctrl(flash);
break;
 
case V4L2_CID_FLASH_STROBE_STOP:
-   if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH)
-   return -EBUSY;
+   if (flash->led_mode != V4L2_FLASH_LED_MODE_FLASH) {
+   rval = -EBUSY;
+   goto err_out;
+   }
flash->led_mode = V4L2_FLASH_LED_MODE_NONE;
rval = lm3560_mode_ctrl(flash);
break;
@@ -247,8 +251,8 @@ static int lm3560_set_ctrl(struct v4l2_ctrl *ctrl, enum 
lm3560_led_id led_no)
break;
}
 
-   mutex_unlock(&flash->lock);
 err_out:
+   mutex_unlock(&flash->lock);
return rval;
 }
 

--
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 -next] [media] v4l: ti-vpe: fix return value check in vpe_probe()

2013-10-29 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function devm_kzalloc() and devm_ioremap()
returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return
value check should be replaced with NULL test.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/ti-vpe/vpe.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/ti-vpe/vpe.c 
b/drivers/media/platform/ti-vpe/vpe.c
index 4e58069..90cf369 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -1942,8 +1942,8 @@ static int vpe_probe(struct platform_device *pdev)
int ret, irq, func;
 
dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
-   if (IS_ERR(dev))
-   return PTR_ERR(dev);
+   if (!dev)
+   return -ENOMEM;
 
spin_lock_init(&dev->lock);
 
@@ -1962,8 +1962,8 @@ static int vpe_probe(struct platform_device *pdev)
 * registers based on the sub block base addresses
 */
dev->base = devm_ioremap(&pdev->dev, res->start, SZ_32K);
-   if (IS_ERR(dev->base)) {
-   ret = PTR_ERR(dev->base);
+   if (!dev->base) {
+   ret = -ENOMEM;
goto v4l2_dev_unreg;
}
 

--
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 -next] [media] v4l: ti-vpe: fix error return code in vpe_probe()

2013-10-29 Thread Wei Yongjun
From: Wei Yongjun 

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 
---
 drivers/media/platform/ti-vpe/vpe.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/ti-vpe/vpe.c 
b/drivers/media/platform/ti-vpe/vpe.c
index 4e58069..0dbfd52 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -2007,8 +2007,10 @@ static int vpe_probe(struct platform_device *pdev)
vpe_top_vpdma_reset(dev);
 
dev->vpdma = vpdma_create(pdev);
-   if (IS_ERR(dev->vpdma))
+   if (IS_ERR(dev->vpdma)) {
+   ret = PTR_ERR(dev->vpdma);
goto runtime_put;
+   }
 
vfd = &dev->vfd;
*vfd = vpe_videodev;

--
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 -next] [media] v4l: ti-vpe: use module_platform_driver to simplify the code

2013-10-29 Thread Wei Yongjun
From: Wei Yongjun 

module_platform_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/ti-vpe/vpe.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/media/platform/ti-vpe/vpe.c 
b/drivers/media/platform/ti-vpe/vpe.c
index 4e58069..89658a3 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -2081,18 +2081,7 @@ static struct platform_driver vpe_pdrv = {
},
 };
 
-static void __exit vpe_exit(void)
-{
-   platform_driver_unregister(&vpe_pdrv);
-}
-
-static int __init vpe_init(void)
-{
-   return platform_driver_register(&vpe_pdrv);
-}
-
-module_init(vpe_init);
-module_exit(vpe_exit);
+module_platform_driver(vpe_pdrv);
 
 MODULE_DESCRIPTION("TI VPE driver");
 MODULE_AUTHOR("Dale Farnsworth, ");

--
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] saa7164: fix return value check in saa7164_initdev()

2013-10-25 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function kthread_run() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun 
---
 drivers/media/pci/saa7164/saa7164-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/pci/saa7164/saa7164-core.c 
b/drivers/media/pci/saa7164/saa7164-core.c
index d37ee37..896bd8b 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -1354,9 +1354,11 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
if (fw_debug) {
dev->kthread = kthread_run(saa7164_thread_function, dev,
"saa7164 debug");
-   if (!dev->kthread)
+   if (IS_ERR(dev->kthread)) {
+   dev->kthread = NULL;
printk(KERN_ERR "%s() Failed to create "
"debug kernel thread\n", __func__);
+   }
}
 
} /* != BOARD_UNKNOWN */

--
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] marvell-ccic: drop free_irq for devm_request_irq allocated irq

2013-09-23 Thread Wei Yongjun
From: Wei Yongjun 

irq allocated with devm_request_irq should not be freed using
free_irq, because doing so causes a dangling pointer, and a
subsequent double free.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/marvell-ccic/mmp-driver.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c 
b/drivers/media/platform/marvell-ccic/mmp-driver.c
index b5a19af..3458fa0 100644
--- a/drivers/media/platform/marvell-ccic/mmp-driver.c
+++ b/drivers/media/platform/marvell-ccic/mmp-driver.c
@@ -481,7 +481,6 @@ static int mmpcam_remove(struct mmp_camera *cam)
struct mmp_camera_platform_data *pdata;
 
mmpcam_remove_device(cam);
-   free_irq(cam->irq, mcam);
mccic_shutdown(mcam);
mmpcam_power_down(mcam);
pdata = cam->pdev->dev.platform_data;

--
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] v4l: vsp1: fix error return code in vsp1_video_init()

2013-09-11 Thread Wei Yongjun
From: Wei Yongjun 

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 
---
 drivers/media/platform/vsp1/vsp1_video.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/vsp1/vsp1_video.c 
b/drivers/media/platform/vsp1/vsp1_video.c
index 714c53e..4b0ac07 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -1026,8 +1026,10 @@ int vsp1_video_init(struct vsp1_video *video, struct 
vsp1_entity *rwpf)
 
/* ... and the buffers queue... */
video->alloc_ctx = vb2_dma_contig_init_ctx(video->vsp1->dev);
-   if (IS_ERR(video->alloc_ctx))
+   if (IS_ERR(video->alloc_ctx)) {
+   ret = PTR_ERR(video->alloc_ctx);
goto error;
+   }
 
video->queue.type = video->type;
video->queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF;

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

2013-09-11 Thread Wei Yongjun
From: Wei Yongjun 

Fix to return -ENOMEM in the new i2c client and create workqueue error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun 
---
 drivers/media/i2c/adv7511.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c
index 7a576097..665b0c9 100644
--- a/drivers/media/i2c/adv7511.c
+++ b/drivers/media/i2c/adv7511.c
@@ -1126,6 +1126,7 @@ static int adv7511_probe(struct i2c_client *client, const 
struct i2c_device_id *
state->i2c_edid = i2c_new_dummy(client->adapter, state->i2c_edid_addr 
>> 1);
if (state->i2c_edid == NULL) {
v4l2_err(sd, "failed to register edid i2c client\n");
+   err = -ENOMEM;
goto err_entity;
}
 
@@ -1133,6 +1134,7 @@ static int adv7511_probe(struct i2c_client *client, const 
struct i2c_device_id *
state->work_queue = create_singlethread_workqueue(sd->name);
if (state->work_queue == NULL) {
v4l2_err(sd, "could not create workqueue\n");
+   err = -ENOMEM;
goto err_unreg_cec;
}
 

--
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 -next v2] [media] davinci: vpif_capture: fix error return code in vpif_probe()

2013-09-02 Thread Wei Yongjun
From: Wei Yongjun 

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

Introduced by commit 873229e4fdf34196aa5d707957c59ba54c25eaba
([media] media: davinci: vpif: capture: add V4L2-async support)

Signed-off-by: Wei Yongjun 
---
v1 -> v2: fix mistake using -ENOMEM
---
 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 7fbde6d..e4b6a26 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -2160,6 +2160,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,


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

2013-08-22 Thread Wei Yongjun
From: Wei Yongjun 

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

Introduced by commit 873229e4fdf34196aa5d707957c59ba54c25eaba
([media] media: davinci: vpif: capture: add V4L2-async support)

Signed-off-by: Wei Yongjun 
---
 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 7fbde6d..e4b6a26 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -2160,6 +2160,7 @@ static __init int vpif_probe(struct platform_device *pdev)
 
if (!vpif_obj.sd[i]) {
vpif_err("Error registering v4l2 subdevice\n");
+   err = -ENOMEM;
goto probe_subdev_out;
}
v4l2_info(&vpif_obj.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 -next] [media] davinci: vpif_display: fix error return code in vpif_probe()

2013-08-22 Thread Wei Yongjun
From: Wei Yongjun 

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

Introduce by commit 4b8a531e6bb0686203e9cf82a54dfe189de7d5c2.
([media] media: davinci: vpif: display: add V4L2-async support)

Signed-off-by: Wei Yongjun 
---
 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 6336dfc..0e03b9a 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1824,6 +1824,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 -next] [media] usbtv: remove unused including

2013-07-16 Thread Wei Yongjun
From: Wei Yongjun 

Remove including  that don't need it.

Signed-off-by: Wei Yongjun 
---
 drivers/media/usb/usbtv/usbtv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/usb/usbtv/usbtv.c b/drivers/media/usb/usbtv/usbtv.c
index bf43f87..68fe97f 100644
--- a/drivers/media/usb/usbtv/usbtv.c
+++ b/drivers/media/usb/usbtv/usbtv.c
@@ -33,7 +33,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 

--
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 -next] [media] coda: fix missing unlock on error in coda_stop_streaming()

2013-06-18 Thread Wei Yongjun
On 06/18/2013 06:03 PM, Philipp Zabel wrote:
> Am Dienstag, den 18.06.2013, 13:00 +0800 schrieb Wei Yongjun:
>> From: Wei Yongjun 
>>
>> Add the missing unlock before return from function coda_stop_streaming()
>> in the error handling case.
>>
>> Signed-off-by: Wei Yongjun 
>> ---
>>  drivers/media/platform/coda.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
>> index df4ada88..2c3cd17 100644
>> --- a/drivers/media/platform/coda.c
>> +++ b/drivers/media/platform/coda.c
>> @@ -1347,6 +1347,7 @@ static int coda_stop_streaming(struct vb2_queue *q)
>>  if (coda_command_sync(ctx, CODA_COMMAND_SEQ_END)) {
>>  v4l2_err(&dev->v4l2_dev,
>>   "CODA_COMMAND_SEQ_END failed\n");
>> +mutex_unlock(&dev->coda_mutex);
>>  return -ETIMEDOUT;
>>  }
>>  mutex_unlock(&dev->coda_mutex);
>>
>>
> Thanks! If you don't mind, I'll integrate this change into the "[media]
> coda: add CODA7541 decoding support" for v2.

No problem. Thanks.

Yongjun Wei

--
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 -next] [media] coda: fix missing unlock on error in coda_stop_streaming()

2013-06-17 Thread Wei Yongjun
From: Wei Yongjun 

Add the missing unlock before return from function coda_stop_streaming()
in the error handling case.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/coda.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
index df4ada88..2c3cd17 100644
--- a/drivers/media/platform/coda.c
+++ b/drivers/media/platform/coda.c
@@ -1347,6 +1347,7 @@ static int coda_stop_streaming(struct vb2_queue *q)
if (coda_command_sync(ctx, CODA_COMMAND_SEQ_END)) {
v4l2_err(&dev->v4l2_dev,
 "CODA_COMMAND_SEQ_END failed\n");
+   mutex_unlock(&dev->coda_mutex);
return -ETIMEDOUT;
}
mutex_unlock(&dev->coda_mutex);

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

2013-05-13 Thread Wei Yongjun
From: Wei Yongjun 

The orig code will release all the resources if v4l2_device_register()
failed and return 0. But what we need in this case is to return an
negative error code to let the caller known we are failed.
So the patch save the return value of v4l2_device_register() to 'ret'
and return it when error.

Signed-off-by: Wei Yongjun 
---
v1 -> v2: change the commit message
---
 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


Re: [PATCH] [media] sta2x11_vip: fix error return code in sta2x11_vip_init_one()

2013-05-13 Thread Wei Yongjun
On 05/13/2013 08:19 PM, Federico Vaga wrote:
> Hello,
>
> I agree with the content of the patch, but I disagree with the commit 
> message. 
> >From the commit message it seems that you fixed a bug about the error code, 
> but the aim of this patch is to uniform the code style. I suggest something 
> like: "uniform code style in sta2x11_vip_init_one()"

The orig code will release all the resources if v4l2_device_register()
failed and return 0.
But what we need in this case is to return an negative error code
to let the caller known we are failed. So the patch save the return
value of v4l2_device_register() to 'ret' and return it when error.


>
> On Monday 13 May 2013 13:59:45 Wei Yongjun wrote:
>> From: Wei Yongjun 
>>
>> 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 
>> ---
>>  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


[PATCH v2] [media] blackfin: fix error return code in bcap_probe()

2013-05-13 Thread Wei Yongjun
From: Wei Yongjun 

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 
---
v1 -> v2: move config->num_inputs check to the beginning of this function
---
 drivers/media/platform/blackfin/bfin_capture.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/blackfin/bfin_capture.c 
b/drivers/media/platform/blackfin/bfin_capture.c
index 0e55b08..391d9a9 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -960,7 +960,7 @@ static int bcap_probe(struct platform_device *pdev)
int ret;
 
config = pdev->dev.platform_data;
-   if (!config) {
+   if (!config || !config->num_inputs) {
v4l2_err(pdev->dev.driver, "Unable to get board config\n");
return -ENODEV;
}
@@ -1067,11 +1067,6 @@ static int bcap_probe(struct platform_device *pdev)
 NULL);
if (bcap_dev->sd) {
int i;
-   if (!config->num_inputs) {
-   v4l2_err(&bcap_dev->v4l2_dev,
-   "Unable to work without input\n");
-   goto err_unreg_vdev;
-   }
 
/* update tvnorms from the sub devices */
for (i = 0; i < config->num_inputs; i++)
@@ -1079,6 +1074,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] ad9389b: fix error return code in ad9389b_probe()

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun 

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 
---
 drivers/media/i2c/ad9389b.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
index 58344b6..decef36 100644
--- a/drivers/media/i2c/ad9389b.c
+++ b/drivers/media/i2c/ad9389b.c
@@ -1251,12 +1251,14 @@ static int ad9389b_probe(struct i2c_client *client, 
const struct i2c_device_id *
state->edid_i2c_client = i2c_new_dummy(client->adapter, (0x7e>>1));
if (state->edid_i2c_client == NULL) {
v4l2_err(sd, "failed to register edid i2c client\n");
+   err = -ENOMEM;
goto err_entity;
}
 
state->work_queue = create_singlethread_workqueue(sd->name);
if (state->work_queue == NULL) {
v4l2_err(sd, "could not create workqueue\n");
+   err = -ENOMEM;
goto err_unreg;
}
 

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

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


[PATCH] [media] blackfin: fix error return code in bcap_probe()

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun 

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

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun 

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

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun 

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

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun 

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 
---
 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] v4l: vb2: fix error return code in __vb2_init_fileio()

2013-05-12 Thread Wei Yongjun
From: Wei Yongjun 

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 
---
 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] davinci: vpfe: fix error return code in vpfe_probe()

2013-05-07 Thread Wei Yongjun
From: Wei Yongjun 

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 
---
 drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c 
b/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
index b88e1dd..d8ce20d 100644
--- a/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
+++ b/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
@@ -639,7 +639,8 @@ static int vpfe_probe(struct platform_device *pdev)
if (ret)
goto probe_free_dev_mem;
 
-   if (vpfe_initialize_modules(vpfe_dev, pdev))
+   ret = vpfe_initialize_modules(vpfe_dev, pdev);
+   if (ret)
goto probe_disable_clock;
 
vpfe_dev->media_dev.dev = vpfe_dev->pdev;
@@ -663,7 +664,8 @@ static int vpfe_probe(struct platform_device *pdev)
/* set the driver data in platform device */
platform_set_drvdata(pdev, vpfe_dev);
/* register subdevs/entities */
-   if (vpfe_register_entities(vpfe_dev))
+   ret = vpfe_register_entities(vpfe_dev);
+   if (ret)
goto probe_out_v4l2_unregister;
 
ret = vpfe_attach_irq(vpfe_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 -next] [media] s5p-mfc: fix error return code in s5p_mfc_probe()

2013-04-17 Thread Wei Yongjun
From: Wei Yongjun 

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

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index e810b1a..a5853fa 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1110,7 +1110,8 @@ static int s5p_mfc_probe(struct platform_device *pdev)
}
 
if (pdev->dev.of_node) {
-   if (s5p_mfc_alloc_memdevs(dev) < 0)
+   ret = s5p_mfc_alloc_memdevs(dev);
+   if (ret < 0)
goto err_res;
} else {
dev->mem_dev_l = device_find_child(&dev->plat_dev->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] rc: ene_ir: fix potential double free in ene_probe()

2013-04-09 Thread Wei Yongjun
From: Wei Yongjun 

Since rc_unregister_device() frees its argument, the subsequently
call to rc_free_device() on the same variable will cause a double
free bug. Fix by set argument to NULL, thus when fall through to
rc_free_device(), nothing will be done there.

Signed-off-by: Wei Yongjun 
---
 drivers/media/rc/ene_ir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
index ee6c984..ed184f6 100644
--- a/drivers/media/rc/ene_ir.c
+++ b/drivers/media/rc/ene_ir.c
@@ -1098,6 +1098,7 @@ exit_release_hw_io:
release_region(dev->hw_io, ENE_IO_SIZE);
 exit_unregister_device:
rc_unregister_device(rdev);
+   rdev = NULL;
 exit_free_dev_rdev:
rc_free_device(rdev);
kfree(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] rc: nuvoton-cir: fix potential double free in nvt_probe()

2013-04-09 Thread Wei Yongjun
From: Wei Yongjun 

Since rc_unregister_device() frees its argument, the subsequently
call to rc_free_device() on the same variable will cause a double
free bug. Fix by set argument to NULL, thus when fall through to
rc_free_device(), nothing will be done there.

Signed-off-by: Wei Yongjun 
---
 drivers/media/rc/nuvoton-cir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index 40125d7..21ee0dc 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -1107,6 +1107,7 @@ exit_release_cir_addr:
release_region(nvt->cir_addr, CIR_IOREG_LENGTH);
 exit_unregister_device:
rc_unregister_device(rdev);
+   rdev = NULL;
 exit_free_dev_rdev:
rc_free_device(rdev);
kfree(nvt);

--
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: ite-cir: fix potential double free in ite_probe()

2013-04-09 Thread Wei Yongjun
From: Wei Yongjun 

Since rc_unregister_device() frees its argument, the subsequently
call to rc_free_device() on the same variable will cause a double
free bug. Fix by set argument to NULL, thus when fall through to
rc_free_device(), nothing will be done there.

Signed-off-by: Wei Yongjun 
---
 drivers/media/rc/ite-cir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index dd82373..63b4225 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -1613,6 +1613,7 @@ exit_release_cir_addr:
release_region(itdev->cir_addr, itdev->params.io_region_size);
 exit_unregister_device:
rc_unregister_device(rdev);
+   rdev = NULL;
 exit_free_dev_rdev:
rc_free_device(rdev);
kfree(itdev);

--
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: winbond-cir: fix potential double free in wbcir_probe()

2013-04-09 Thread Wei Yongjun
From: Wei Yongjun 

Since rc_unregister_device() frees its argument, the subsequently
call to rc_free_device() on the same variable will cause a double
free bug. Fix by set argument to NULL, thus when fall through to
rc_free_device(), nothing will be done there.

Signed-off-by: Wei Yongjun 
---
 drivers/media/rc/winbond-cir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 535a18d..87af2d3 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -1151,6 +1151,7 @@ exit_release_wbase:
release_region(data->wbase, WAKEUP_IOMEM_LEN);
 exit_unregister_device:
rc_unregister_device(data->dev);
+   data->dev = NULL;
 exit_free_rc:
rc_free_device(data->dev);
 exit_unregister_led:

--
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: ttusbir: fix potential double free in ttusbir_probe()

2013-04-09 Thread Wei Yongjun
From: Wei Yongjun 

Since rc_unregister_device() frees its argument, the subsequently
call to rc_free_device() on the same variable will cause a double
free bug. Fix by set argument to NULL, thus when fall through to
rc_free_device(), nothing will be done there.

Signed-off-by: Wei Yongjun 
---
 drivers/media/rc/ttusbir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c
index cf0d47f..891762d 100644
--- a/drivers/media/rc/ttusbir.c
+++ b/drivers/media/rc/ttusbir.c
@@ -347,6 +347,7 @@ static int ttusbir_probe(struct usb_interface *intf,
return 0;
 out3:
rc_unregister_device(rc);
+   rc = NULL;
 out2:
led_classdev_unregister(&tt->led);
 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 -next v2] [media] go7007: fix invalid use of sizeof in go7007_usb_i2c_master_xfer()

2013-03-26 Thread Wei Yongjun
From: Wei Yongjun 

sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Signed-off-by: Wei Yongjun 
---
 drivers/staging/media/go7007/go7007-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/go7007/go7007-usb.c 
b/drivers/staging/media/go7007/go7007-usb.c
index 0823506..d455c0b 100644
--- a/drivers/staging/media/go7007/go7007-usb.c
+++ b/drivers/staging/media/go7007/go7007-usb.c
@@ -1035,7 +1035,7 @@ static int go7007_usb_i2c_master_xfer(struct i2c_adapter 
*adapter,
buf, buf_len, 0) < 0)
goto i2c_done;
if (msgs[i].flags & I2C_M_RD) {
-   memset(buf, 0, sizeof(buf));
+   memset(buf, 0, msgs[i].len + 1);
if (go7007_usb_vendor_request(go, 0x25, 0, 0, buf,
msgs[i].len + 1, 1) < 0)
goto i2c_done;


--
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 -next] [media] go7007: fix invalid use of sizeof in go7007_usb_i2c_master_xfer()

2013-03-26 Thread Wei Yongjun
Hi Hans and Dan Carpenter,

On 03/26/2013 04:18 PM, Hans Verkuil wrote:
> On Tue March 26 2013 08:35:57 Dan Carpenter wrote:
>> On Tue, Mar 26, 2013 at 10:04:15AM +0300, Dan Carpenter wrote:
>>> On Tue, Mar 26, 2013 at 02:42:47PM +0800, Wei Yongjun wrote:
>>>> From: Wei Yongjun 
>>>>
>>>> sizeof() when applied to a pointer typed expression gives the
>>>> size of the pointer, not that of the pointed data.
>>>>
>>> This fix isn't right.  "buf" is a char pointer.  I don't know what
>>> this code is doing.  Instead of sizeof(*buf) it should be something
>>> like "buflen", "msg[i].len", "msg[i].len + 1" or "msg[i].len + 3".
>> It should be "msg[i].len + 1", I think.
> Yes, that's correct.
>
> 'buf' used to be a local array, so the memset was fine. I changed it to an
> array that was kmalloc()ed but forgot about the memset. I never noticed
> the bug because the sizeof the message is typically quite small, certainly
> smaller than sizeof(pointer) on a 64-bit system.
>
> Wei Yongjun, can you post a new patch fixing this?

Thanks very much, I will send the v2 of this patch soon.

Regards,
Yongjun





--
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 -next] [media] go7007: fix invalid use of sizeof in go7007_usb_i2c_master_xfer()

2013-03-25 Thread Wei Yongjun
From: Wei Yongjun 

sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Signed-off-by: Wei Yongjun 
---
 drivers/staging/media/go7007/go7007-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/go7007/go7007-usb.c 
b/drivers/staging/media/go7007/go7007-usb.c
index 0823506..7219ae0 100644
--- a/drivers/staging/media/go7007/go7007-usb.c
+++ b/drivers/staging/media/go7007/go7007-usb.c
@@ -1035,7 +1035,7 @@ static int go7007_usb_i2c_master_xfer(struct i2c_adapter 
*adapter,
buf, buf_len, 0) < 0)
goto i2c_done;
if (msgs[i].flags & I2C_M_RD) {
-   memset(buf, 0, sizeof(buf));
+   memset(buf, 0, sizeof(*buf));
if (go7007_usb_vendor_request(go, 0x25, 0, 0, buf,
msgs[i].len + 1, 1) < 0)
goto i2c_done;


--
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 -next] [media] tw9906: remove unused including

2013-03-25 Thread Wei Yongjun
From: Wei Yongjun 

Remove including  that don't need it.

Signed-off-by: Wei Yongjun 
---
 drivers/media/i2c/tw9906.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/i2c/tw9906.c b/drivers/media/i2c/tw9906.c
index 2263a91..d94325b 100644
--- a/drivers/media/i2c/tw9906.c
+++ b/drivers/media/i2c/tw9906.c
@@ -17,7 +17,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

--
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 -next] [media] go7007: remove unused including

2013-03-25 Thread Wei Yongjun
From: Wei Yongjun 

Remove including  that don't need it.

Signed-off-by: Wei Yongjun 
---
 drivers/staging/media/go7007/go7007-v4l2.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/go7007/go7007-v4l2.c 
b/drivers/staging/media/go7007/go7007-v4l2.c
index 24ba50e..50eb69a 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -17,7 +17,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 


--
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 -next] [media] af9035: fix missing unlock on error in af9035_ctrl_msg()

2013-03-25 Thread Wei Yongjun
From: Wei Yongjun 

Add the missing unlock before return from function af9035_ctrl_msg()
in the error handling case.

Signed-off-by: Wei Yongjun 
---
 drivers/media/usb/dvb-usb-v2/af9035.c | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c 
b/drivers/media/usb/dvb-usb-v2/af9035.c
index b1f7059..b638fc1 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -57,7 +57,7 @@ static int af9035_ctrl_msg(struct dvb_usb_device *d, struct 
usb_req *req)
dev_err(&d->udev->dev, "%s: too much data wlen=%d rlen=%d\n",
__func__, req->wlen, req->rlen);
ret = -EINVAL;
-   goto err;
+   goto exit;
}
 
state->buf[0] = REQ_HDR_LEN + req->wlen + CHECKSUM_LEN - 1;
@@ -81,7 +81,7 @@ static int af9035_ctrl_msg(struct dvb_usb_device *d, struct 
usb_req *req)
ret = dvb_usbv2_generic_rw_locked(d,
state->buf, wlen, state->buf, rlen);
if (ret)
-   goto err;
+   goto exit;
 
/* no ack for those packets */
if (req->cmd == CMD_FW_DL)
@@ -95,28 +95,29 @@ static int af9035_ctrl_msg(struct dvb_usb_device *d, struct 
usb_req *req)
"(%04x != %04x)\n", KBUILD_MODNAME, req->cmd,
tmp_checksum, checksum);
ret = -EIO;
-   goto err;
+   goto exit;
}
 
/* check status */
if (state->buf[2]) {
/* fw returns status 1 when IR code was not received */
-   if (req->cmd == CMD_IR_GET || state->buf[2] == 1)
-   return 1;
+   if (req->cmd == CMD_IR_GET || state->buf[2] == 1) {
+   ret = 1;
+   goto exit;
+   }
 
dev_dbg(&d->udev->dev, "%s: command=%02x failed fw error=%d\n",
__func__, req->cmd, state->buf[2]);
ret = -EIO;
-   goto err;
+   goto exit;
}
 
/* read request, copy returned data to return buf */
if (req->rlen)
memcpy(req->rbuf, &state->buf[ACK_HDR_LEN], req->rlen);
 exit:
-err:
mutex_unlock(&d->usb_mutex);
-   if (ret)
+   if (ret < 0)
dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, 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 -next] [media] dvb_usb_v2: make local function dvb_usb_v2_generic_io() static

2013-03-21 Thread Wei Yongjun
From: Wei Yongjun 

dvb_usb_v2_generic_io() was not declared. It should be static.

Signed-off-by: Wei Yongjun 
---
 drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c 
b/drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c
index 74c911f..aa0c35e 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c
@@ -21,7 +21,7 @@
 
 #include "dvb_usb_common.h"
 
-int dvb_usb_v2_generic_io(struct dvb_usb_device *d,
+static int dvb_usb_v2_generic_io(struct dvb_usb_device *d,
u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
 {
int ret, actual_length;

--
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 -next] [media] gspca: remove needless check before usb_free_coherent()

2013-03-20 Thread Wei Yongjun
From: Wei Yongjun 

usb_free_coherent() is safe with NULL addr and this check is
not required.

Signed-off-by: Wei Yongjun 
---
 drivers/media/usb/gspca/gspca.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c
index 5800d65..924e032 100644
--- a/drivers/media/usb/gspca/gspca.c
+++ b/drivers/media/usb/gspca/gspca.c
@@ -567,11 +567,10 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
 
gspca_dev->urb[i] = NULL;
usb_kill_urb(urb);
-   if (urb->transfer_buffer != NULL)
-   usb_free_coherent(gspca_dev->dev,
- urb->transfer_buffer_length,
- urb->transfer_buffer,
- urb->transfer_dma);
+   usb_free_coherent(gspca_dev->dev,
+ urb->transfer_buffer_length,
+ urb->transfer_buffer,
+ urb->transfer_dma);
usb_free_urb(urb);
}
 }


--
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 -next] [media] davinci: vpbe: remove unused variable in vpbe_initialize()

2012-12-02 Thread Wei Yongjun
From: Wei Yongjun 

The variable 'output_index' is initialized but never used
otherwise, so remove the unused variable.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/davinci/vpbe.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe.c 
b/drivers/media/platform/davinci/vpbe.c
index 7f5cf9b..e0c79c1 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -584,7 +584,6 @@ static int vpbe_initialize(struct device *dev, struct 
vpbe_device *vpbe_dev)
struct v4l2_subdev **enc_subdev;
struct osd_state *osd_device;
struct i2c_adapter *i2c_adap;
-   int output_index;
int num_encoders;
int ret = 0;
int err;
@@ -731,7 +730,6 @@ static int vpbe_initialize(struct device *dev, struct 
vpbe_device *vpbe_dev)
/* set the current encoder and output to that of venc by default */
vpbe_dev->current_sd_index = 0;
vpbe_dev->current_out_index = 0;
-   output_index = 0;
 
mutex_unlock(&vpbe_dev->lock);
 


--
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 -next] [media] media: davinci: vpbe: return error code on error in vpbe_display_g_crop()

2012-12-02 Thread Wei Yongjun
From: Wei Yongjun 

We have assigned error code to 'ret' if crop->type is not
V4L2_BUF_TYPE_VIDEO_OUTPUT, but never use it. 
We'd better return the error code on this error.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/davinci/vpbe_display.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe_display.c 
b/drivers/media/platform/davinci/vpbe_display.c
index 2bfde79..119a100 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -791,7 +791,6 @@ static int vpbe_display_g_crop(struct file *file, void 
*priv,
struct vpbe_device *vpbe_dev = fh->disp_dev->vpbe_dev;
struct osd_state *osd_device = fh->disp_dev->osd_device;
struct v4l2_rect *rect = &crop->c;
-   int ret;
 
v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev,
"VIDIOC_G_CROP, layer id = %d\n",
@@ -799,7 +798,7 @@ static int vpbe_display_g_crop(struct file *file, void 
*priv,
 
if (crop->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) {
v4l2_err(&vpbe_dev->v4l2_dev, "Invalid buf type\n");
-   ret = -EINVAL;
+   return -EINVAL;
}
osd_device->ops.get_layer_config(osd_device,
layer->layer_info.id, cfg);


--
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 -next] [media] s5p-mfc: remove unused variable

2012-12-02 Thread Wei Yongjun
From: Wei Yongjun 

The variable index is initialized but never used
otherwise, so remove the unused variable.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c| 5 -
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 6 --
 2 files changed, 11 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 3afe879..856cf00 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -273,7 +273,6 @@ static void s5p_mfc_handle_frame_new(struct s5p_mfc_ctx 
*ctx, unsigned int err)
struct s5p_mfc_buf  *dst_buf;
size_t dspl_y_addr;
unsigned int frame_type;
-   unsigned int index;
 
dspl_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_y_adr, dev);
frame_type = s5p_mfc_hw_call(dev->mfc_ops, get_dec_frame_type, dev);
@@ -310,7 +309,6 @@ static void s5p_mfc_handle_frame_new(struct s5p_mfc_ctx 
*ctx, unsigned int err)
vb2_buffer_done(dst_buf->b,
err ? VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
 
-   index = dst_buf->b->v4l2_buf.index;
break;
}
}
@@ -326,8 +324,6 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx,
unsigned long flags;
unsigned int res_change;
 
-   unsigned int index;
-
dst_frame_status = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_status, dev)
& S5P_FIMV_DEC_STATUS_DECODING_STATUS_MASK;
res_change = (s5p_mfc_hw_call(dev->mfc_ops, get_dspl_status, dev)
@@ -387,7 +383,6 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx,
mfc_debug(2, "Running again the same buffer\n");
ctx->after_packed_pb = 1;
} else {
-   index = src_buf->b->v4l2_buf.index;
mfc_debug(2, "MFC needs next buffer\n");
ctx->consumed_stream = 0;
list_del(&src_buf->list);

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
index 3a8cfd9..bf4d2f4 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
@@ -1408,7 +1408,6 @@ static inline int s5p_mfc_run_dec_frame(struct 
s5p_mfc_ctx *ctx)
struct s5p_mfc_buf *temp_vb;
unsigned long flags;
int last_frame = 0;
-   unsigned int index;
 
spin_lock_irqsave(&dev->irqlock, flags);
 
@@ -1427,8 +1426,6 @@ static inline int s5p_mfc_run_dec_frame(struct 
s5p_mfc_ctx *ctx)
temp_vb->b->v4l2_planes[0].bytesused);
spin_unlock_irqrestore(&dev->irqlock, flags);
 
-   index = temp_vb->b->v4l2_buf.index;
-
dev->curr_ctx = ctx->num;
s5p_mfc_clean_ctx_int_flags(ctx);
if (temp_vb->b->v4l2_planes[0].bytesused == 0) {
@@ -1452,7 +1449,6 @@ static inline int s5p_mfc_run_enc_frame(struct 
s5p_mfc_ctx *ctx)
unsigned int src_y_size, src_c_size;
*/
unsigned int dst_size;
-   unsigned int index;
 
spin_lock_irqsave(&dev->irqlock, flags);
 
@@ -1487,8 +1483,6 @@ static inline int s5p_mfc_run_enc_frame(struct 
s5p_mfc_ctx *ctx)
 
spin_unlock_irqrestore(&dev->irqlock, flags);
 
-   index = src_mb->b->v4l2_buf.index;
-
dev->curr_ctx = ctx->num;
s5p_mfc_clean_ctx_int_flags(ctx);
s5p_mfc_encode_one_frame_v6(ctx);

--
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 -next] [media] media: davinci: vpbe: fix return value check in vpbe_display_reqbufs()

2012-12-02 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function vb2_dma_contig_init_ctx() returns
ERR_PTR() and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/davinci/vpbe_display.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe_display.c 
b/drivers/media/platform/davinci/vpbe_display.c
index 2bfde79..e181a52 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -1393,9 +1393,9 @@ static int vpbe_display_reqbufs(struct file *file, void 
*priv,
}
/* Initialize videobuf queue as per the buffer type */
layer->alloc_ctx = vb2_dma_contig_init_ctx(vpbe_dev->pdev);
-   if (!layer->alloc_ctx) {
+   if (IS_ERR(layer->alloc_ctx)) {
v4l2_err(&vpbe_dev->v4l2_dev, "Failed to get the context\n");
-   return -EINVAL;
+   return PTR_ERR(layer->alloc_ctx);
}
q = &layer->buffer_queue;
memset(q, 0, sizeof(*q));

--
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 -next] [media] mt9v022: fix potential NULL pointer dereference in mt9v022_probe()

2012-11-28 Thread Wei Yongjun
From: Wei Yongjun 

The dereference to 'icl' should be moved below the NULL test.

Signed-off-by: Wei Yongjun 
---
 drivers/media/i2c/soc_camera/mt9v022.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/soc_camera/mt9v022.c 
b/drivers/media/i2c/soc_camera/mt9v022.c
index d40a885..7509802 100644
--- a/drivers/media/i2c/soc_camera/mt9v022.c
+++ b/drivers/media/i2c/soc_camera/mt9v022.c
@@ -875,7 +875,7 @@ static int mt9v022_probe(struct i2c_client *client,
struct mt9v022 *mt9v022;
struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
-   struct mt9v022_platform_data *pdata = icl->priv;
+   struct mt9v022_platform_data *pdata;
int ret;
 
if (!icl) {
@@ -893,6 +893,7 @@ static int mt9v022_probe(struct i2c_client *client,
if (!mt9v022)
return -ENOMEM;
 
+   pdata = icl->priv;
v4l2_i2c_subdev_init(&mt9v022->subdev, client, &mt9v022_subdev_ops);
v4l2_ctrl_handler_init(&mt9v022->hdl, 6);
v4l2_ctrl_new_std(&mt9v022->hdl, &mt9v022_ctrl_ops,


--
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 v2] [media] vpif_capture: fix return value check

2012-11-15 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function vb2_dma_contig_init_ctx() returns
ERR_PTR() and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/davinci/vpif_display.c | 4 ++--
 drivers/media/platform/davinci/vpif_capture.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_display.c 
b/drivers/media/platform/davinci/vpif_display.c
index b716fbd..5453bbb 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -972,9 +972,9 @@ static int vpif_reqbufs(struct file *file, void *priv,
}
/* Initialize videobuf2 queue as per the buffer type */
common->alloc_ctx = vb2_dma_contig_init_ctx(vpif_dev);
-   if (!common->alloc_ctx) {
+   if (IS_ERR(common->alloc_ctx)) {
vpif_err("Failed to get the context\n");
-   return -EINVAL;
+   return PTR_ERR(common->alloc_ctx);
}
q = &common->buffer_queue;
q->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;

diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index fcabc02..9746324 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1004,9 +1004,9 @@ static int vpif_reqbufs(struct file *file, void *priv,
 
/* Initialize videobuf2 queue as per the buffer type */
common->alloc_ctx = vb2_dma_contig_init_ctx(vpif_dev);
-   if (!common->alloc_ctx) {
+   if (IS_ERR(common->alloc_ctx)) {
vpif_err("Failed to get the context\n");
-   return -EINVAL;
+   return PTR_ERR(common->alloc_ctx);
}
q = &common->buffer_queue;
q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;


--
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] vpif_display: fix return value check in vpif_reqbufs()

2012-11-12 Thread Wei Yongjun
Hi Prabhakar,

On 11/09/2012 08:33 PM, Prabhakar Lad wrote:
> Hi Wei,
>
> Thanks for the patch.
>
> On Wed, Oct 24, 2012 at 4:59 PM, Wei Yongjun  wrote:
>> From: Wei Yongjun 
>>
>> In case of error, the function vb2_dma_contig_init_ctx() returns
>> ERR_PTR() and never returns NULL. The NULL test in the return value
>> check should be replaced with IS_ERR().
>>
>> dpatch engine is used to auto generate this patch.
>> (https://github.com/weiyj/dpatch)
>>
>> Signed-off-by: Wei Yongjun 
>> ---
>>  drivers/media/platform/davinci/vpif_display.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/media/platform/davinci/vpif_display.c 
>> b/drivers/media/platform/davinci/vpif_display.c
>> index b716fbd..5453bbb 100644
>> --- a/drivers/media/platform/davinci/vpif_display.c
>> +++ b/drivers/media/platform/davinci/vpif_display.c
>> @@ -972,9 +972,9 @@ static int vpif_reqbufs(struct file *file, void *priv,
>> }
>> /* Initialize videobuf2 queue as per the buffer type */
>> common->alloc_ctx = vb2_dma_contig_init_ctx(vpif_dev);
>> -   if (!common->alloc_ctx) {
>> +   if (IS_ERR(common->alloc_ctx)) {
> Right check would be IS_ERR_OR_NULL(). Can you merge this
> patch 'vpif_capture: fix return value check in vpif_reqbufs()' with
> this one  and post a v2 with above changes ?

I will merge those two patch into one.
And I never see vb2_dma_contig_init_ctx() can return NULL as a return
value, we still would using IS_ERR_OR_NULL()?

---
void *vb2_dma_contig_init_ctx(struct device *dev)
{
   struct vb2_dc_conf *conf;

   conf = kzalloc(sizeof *conf, GFP_KERNEL);
   if (!conf)
 return ERR_PTR(-ENOMEM);
 
   conf->dev = dev;
 
   return conf;
}
---




--
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 condition logic in vpif_enum_dv_timings()

2012-10-30 Thread Wei Yongjun
From: Wei Yongjun 

The pattern E == C1 && E == C2 is always false. This patch
fix this according to the assumption that && should be ||.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/davinci/vpif_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/davinci/vpif_display.c 
b/drivers/media/platform/davinci/vpif_display.c
index b716fbd..977ee43 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1380,7 +1380,7 @@ vpif_enum_dv_timings(struct file *file, void *priv,
int ret;
 
ret = v4l2_subdev_call(ch->sd, video, enum_dv_timings, timings);
-   if (ret == -ENOIOCTLCMD && ret == -ENODEV)
+   if (ret == -ENOIOCTLCMD || ret == -ENODEV)
return -EINVAL;
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] [media] vpif_capture: fix condition logic in vpif_capture.c

2012-10-30 Thread Wei Yongjun
From: Wei Yongjun 

The pattern E == C1 && E == C2 is always false. This patch
fix this according to the assumption that && should be ||.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/davinci/vpif_capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index fcabc02..2d28a96 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1715,7 +1715,7 @@ vpif_enum_dv_timings(struct file *file, void *priv,
int ret;
 
ret = v4l2_subdev_call(ch->sd, video, enum_dv_timings, timings);
-   if (ret == -ENOIOCTLCMD && ret == -ENODEV)
+   if (ret == -ENOIOCTLCMD || ret == -ENODEV)
return -EINVAL;
return ret;
 }
@@ -1735,7 +1735,7 @@ vpif_query_dv_timings(struct file *file, void *priv,
int ret;
 
ret = v4l2_subdev_call(ch->sd, video, query_dv_timings, timings);
-   if (ret == -ENOIOCTLCMD && ret == -ENODEV)
+   if (ret == -ENOIOCTLCMD || ret == -ENODEV)
return -ENODATA;
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] [media] vpif_capture: fix condition logic in vpif_capture.c

2012-10-30 Thread Wei Yongjun
From: Wei Yongjun 

The pattern E == C1 && E == C2 is always false. This patch
fix this according to the assumption that && should be ||.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/davinci/vpif_capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index fcabc02..2d28a96 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1715,7 +1715,7 @@ vpif_enum_dv_timings(struct file *file, void *priv,
int ret;
 
ret = v4l2_subdev_call(ch->sd, video, enum_dv_timings, timings);
-   if (ret == -ENOIOCTLCMD && ret == -ENODEV)
+   if (ret == -ENOIOCTLCMD || ret == -ENODEV)
return -EINVAL;
return ret;
 }
@@ -1735,7 +1735,7 @@ vpif_query_dv_timings(struct file *file, void *priv,
int ret;
 
ret = v4l2_subdev_call(ch->sd, video, query_dv_timings, timings);
-   if (ret == -ENOIOCTLCMD && ret == -ENODEV)
+   if (ret == -ENOIOCTLCMD || ret == -ENODEV)
return -ENODATA;
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] [media] vpif_display: fix return value check in vpif_reqbufs()

2012-10-24 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function vb2_dma_contig_init_ctx() returns
ERR_PTR() and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/davinci/vpif_display.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_display.c 
b/drivers/media/platform/davinci/vpif_display.c
index b716fbd..5453bbb 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -972,9 +972,9 @@ static int vpif_reqbufs(struct file *file, void *priv,
}
/* Initialize videobuf2 queue as per the buffer type */
common->alloc_ctx = vb2_dma_contig_init_ctx(vpif_dev);
-   if (!common->alloc_ctx) {
+   if (IS_ERR(common->alloc_ctx)) {
vpif_err("Failed to get the context\n");
-   return -EINVAL;
+   return PTR_ERR(common->alloc_ctx);
}
q = &common->buffer_queue;
q->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;

--
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 return value check in vpif_reqbufs()

2012-10-24 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function vb2_dma_contig_init_ctx() returns
ERR_PTR() and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/davinci/vpif_capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/davinci/vpif_capture.c 
b/drivers/media/platform/davinci/vpif_capture.c
index fcabc02..9746324 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1004,9 +1004,9 @@ static int vpif_reqbufs(struct file *file, void *priv,
 
/* Initialize videobuf2 queue as per the buffer type */
common->alloc_ctx = vb2_dma_contig_init_ctx(vpif_dev);
-   if (!common->alloc_ctx) {
+   if (IS_ERR(common->alloc_ctx)) {
vpif_err("Failed to get the context\n");
-   return -EINVAL;
+   return PTR_ERR(common->alloc_ctx);
}
q = &common->buffer_queue;
q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;

--
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] davinci: vpbe: fix missing unlock on error in vpbe_initialize()

2012-10-21 Thread Wei Yongjun
From: Wei Yongjun 

Add the missing unlock on the error handling path in function
vpbe_initialize().

Signed-off-by: Wei Yongjun 
---
no test
---
 drivers/media/platform/davinci/vpbe.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe.c 
b/drivers/media/platform/davinci/vpbe.c
index 69d7a58..875e63d 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -632,8 +632,10 @@ static int vpbe_initialize(struct device *dev, struct 
vpbe_device *vpbe_dev)
 
err = bus_for_each_dev(&platform_bus_type, NULL, vpbe_dev,
   platform_device_get);
-   if (err < 0)
-   return err;
+   if (err < 0) {
+   ret = err;
+   goto fail_dev_unregister;
+   }
 
vpbe_dev->venc = venc_sub_dev_init(&vpbe_dev->v4l2_dev,
   vpbe_dev->cfg->venc.module_name);


--
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] mx2_camera: fix missing unlock on error in mx2_start_streaming()

2012-10-21 Thread Wei Yongjun
From: Wei Yongjun 

Add the missing unlock on the error handle path in function
mx2_start_streaming().

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/soc_camera/mx2_camera.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/soc_camera/mx2_camera.c 
b/drivers/media/platform/soc_camera/mx2_camera.c
index 9fd9d1c..ccb9722 100644
--- a/drivers/media/platform/soc_camera/mx2_camera.c
+++ b/drivers/media/platform/soc_camera/mx2_camera.c
@@ -864,8 +864,10 @@ static int mx2_start_streaming(struct vb2_queue *q, 
unsigned int count)
 
bytesperline = soc_mbus_bytes_per_line(icd->user_width,
icd->current_fmt->host_fmt);
-   if (bytesperline < 0)
+   if (bytesperline < 0) {
+   spin_unlock_irqrestore(&pcdev->lock, flags);
return bytesperline;
+   }
 
/*
 * I didn't manage to properly enable/disable the prp
@@ -878,8 +880,10 @@ static int mx2_start_streaming(struct vb2_queue *q, 
unsigned int count)
pcdev->discard_buffer = dma_alloc_coherent(ici->v4l2_dev.dev,
pcdev->discard_size, &pcdev->discard_buffer_dma,
GFP_KERNEL);
-   if (!pcdev->discard_buffer)
+   if (!pcdev->discard_buffer) {
+   spin_unlock_irqrestore(&pcdev->lock, flags);
return -ENOMEM;
+   }
 
pcdev->buf_discard[0].discard = true;
list_add_tail(&pcdev->buf_discard[0].queue,


--
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] i2c: adv7183: use module_i2c_driver to simplify the code

2012-10-08 Thread Wei Yongjun
From: Wei Yongjun 

Use the module_i2c_driver() macro to make the code smaller
and a bit simpler.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/i2c/adv7183.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/media/i2c/adv7183.c b/drivers/media/i2c/adv7183.c
index e1d4c89..10c3c1d 100644
--- a/drivers/media/i2c/adv7183.c
+++ b/drivers/media/i2c/adv7183.c
@@ -681,18 +681,7 @@ static struct i2c_driver adv7183_driver = {
.id_table   = adv7183_id,
 };
 
-static __init int adv7183_init(void)
-{
-   return i2c_add_driver(&adv7183_driver);
-}
-
-static __exit void adv7183_exit(void)
-{
-   i2c_del_driver(&adv7183_driver);
-}
-
-module_init(adv7183_init);
-module_exit(adv7183_exit);
+module_i2c_driver(adv7183_driver);
 
 MODULE_DESCRIPTION("Analog Devices ADV7183 video decoder driver");
 MODULE_AUTHOR("Scott Jiang ");


--
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] i2c: vs6624: use module_i2c_driver to simplify the code

2012-10-08 Thread Wei Yongjun
From: Wei Yongjun 

Use the module_i2c_driver() macro to make the code smaller
and a bit simpler.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/i2c/vs6624.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/media/i2c/vs6624.c b/drivers/media/i2c/vs6624.c
index 42ae9dc..f434a19 100644
--- a/drivers/media/i2c/vs6624.c
+++ b/drivers/media/i2c/vs6624.c
@@ -910,18 +910,7 @@ static struct i2c_driver vs6624_driver = {
.id_table   = vs6624_id,
 };
 
-static __init int vs6624_init(void)
-{
-   return i2c_add_driver(&vs6624_driver);
-}
-
-static __exit void vs6624_exit(void)
-{
-   i2c_del_driver(&vs6624_driver);
-}
-
-module_init(vs6624_init);
-module_exit(vs6624_exit);
+module_i2c_driver(vs6624_driver);
 
 MODULE_DESCRIPTION("VS6624 sensor driver");
 MODULE_AUTHOR("Scott Jiang ");


--
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] staging :go700: use module_i2c_driver to simplify the code

2012-10-08 Thread Wei Yongjun
From: Wei Yongjun 

Use the module_i2c_driver() macro to make the code smaller
and a bit simpler.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/staging/media/go7007/wis-uda1342.c| 13 +
 drivers/staging/media/go7007/wis-tw9903.c | 13 +
 drivers/staging/media/go7007/wis-tw2804.c | 13 +
 drivers/staging/media/go7007/wis-sony-tuner.c | 13 +
 drivers/staging/media/go7007/wis-saa7115.c| 13 +
 drivers/staging/media/go7007/wis-saa7113.c| 13 +
 drivers/staging/media/go7007/wis-ov7640.c | 13 +
 drivers/staging/media/go7007/s2250-board.c| 13 +
 8 files changed, 8 insertions(+), 96 deletions(-)

diff --git a/drivers/staging/media/go7007/wis-uda1342.c 
b/drivers/staging/media/go7007/wis-uda1342.c
index 0127be2..05ac798 100644
--- a/drivers/staging/media/go7007/wis-uda1342.c
+++ b/drivers/staging/media/go7007/wis-uda1342.c
@@ -98,17 +98,6 @@ static struct i2c_driver wis_uda1342_driver = {
.id_table   = wis_uda1342_id,
 };
 
-static int __init wis_uda1342_init(void)
-{
-   return i2c_add_driver(&wis_uda1342_driver);
-}
-
-static void __exit wis_uda1342_cleanup(void)
-{
-   i2c_del_driver(&wis_uda1342_driver);
-}
-
-module_init(wis_uda1342_init);
-module_exit(wis_uda1342_cleanup);
+module_i2c_driver(wis_uda1342_driver);
 
 MODULE_LICENSE("GPL v2");

diff --git a/drivers/staging/media/go7007/wis-tw9903.c 
b/drivers/staging/media/go7007/wis-tw9903.c
index 9230f4a..94071de 100644
--- a/drivers/staging/media/go7007/wis-tw9903.c
+++ b/drivers/staging/media/go7007/wis-tw9903.c
@@ -325,17 +325,6 @@ static struct i2c_driver wis_tw9903_driver = {
.id_table   = wis_tw9903_id,
 };
 
-static int __init wis_tw9903_init(void)
-{
-   return i2c_add_driver(&wis_tw9903_driver);
-}
-
-static void __exit wis_tw9903_cleanup(void)
-{
-   i2c_del_driver(&wis_tw9903_driver);
-}
-
-module_init(wis_tw9903_init);
-module_exit(wis_tw9903_cleanup);
+module_i2c_driver(wis_tw9903_driver);
 
 MODULE_LICENSE("GPL v2");

diff --git a/drivers/staging/media/go7007/wis-tw2804.c 
b/drivers/staging/media/go7007/wis-tw2804.c
index 9134f03..d6410ee 100644
--- a/drivers/staging/media/go7007/wis-tw2804.c
+++ b/drivers/staging/media/go7007/wis-tw2804.c
@@ -341,17 +341,6 @@ static struct i2c_driver wis_tw2804_driver = {
.id_table   = wis_tw2804_id,
 };
 
-static int __init wis_tw2804_init(void)
-{
-   return i2c_add_driver(&wis_tw2804_driver);
-}
-
-static void __exit wis_tw2804_cleanup(void)
-{
-   i2c_del_driver(&wis_tw2804_driver);
-}
-
-module_init(wis_tw2804_init);
-module_exit(wis_tw2804_cleanup);
+module_i2c_driver(wis_tw2804_driver);
 
 MODULE_LICENSE("GPL v2");

diff --git a/drivers/staging/media/go7007/wis-sony-tuner.c 
b/drivers/staging/media/go7007/wis-sony-tuner.c
index 8f1b7d4..1291ab7 100644
--- a/drivers/staging/media/go7007/wis-sony-tuner.c
+++ b/drivers/staging/media/go7007/wis-sony-tuner.c
@@ -704,17 +704,6 @@ static struct i2c_driver wis_sony_tuner_driver = {
.id_table   = wis_sony_tuner_id,
 };
 
-static int __init wis_sony_tuner_init(void)
-{
-   return i2c_add_driver(&wis_sony_tuner_driver);
-}
-
-static void __exit wis_sony_tuner_cleanup(void)
-{
-   i2c_del_driver(&wis_sony_tuner_driver);
-}
-
-module_init(wis_sony_tuner_init);
-module_exit(wis_sony_tuner_cleanup);
+module_i2c_driver(wis_sony_tuner_driver);
 
 MODULE_LICENSE("GPL v2");

diff --git a/drivers/staging/media/go7007/wis-saa7115.c 
b/drivers/staging/media/go7007/wis-saa7115.c
index 46cff59..47a3146 100644
--- a/drivers/staging/media/go7007/wis-saa7115.c
+++ b/drivers/staging/media/go7007/wis-saa7115.c
@@ -453,17 +453,6 @@ static struct i2c_driver wis_saa7115_driver = {
.id_table   = wis_saa7115_id,
 };
 
-static int __init wis_saa7115_init(void)
-{
-   return i2c_add_driver(&wis_saa7115_driver);
-}
-
-static void __exit wis_saa7115_cleanup(void)
-{
-   i2c_del_driver(&wis_saa7115_driver);
-}
-
-module_init(wis_saa7115_init);
-module_exit(wis_saa7115_cleanup);
+module_i2c_driver(wis_saa7115_driver);
 
 MODULE_LICENSE("GPL v2");

diff --git a/drivers/staging/media/go7007/wis-saa7113.c 
b/drivers/staging/media/go7007/wis-saa7113.c
index 05e0e10..f6b6ae8 100644
--- a/drivers/staging/media/go7007/wis-saa7113.c
+++ b/drivers/staging/media/go7007/wis-saa7113.c
@@ -320,17 +320,6 @@ static struct i2c_driver wis_saa7113_driver = {
.id_table   = wis_saa7113_id,
 };
 
-static int __init wis_saa7113_init(void)
-{
-   return i2c_add_driver(&wis_saa7113_driver);
-}
-
-static void __exit wis_saa7113_cleanup(void)
-{
-   i2c_del_driver(&wis_saa7113_driver);
-}
-
-module_init(wis_saa7113_init);
-module_exit(wis_saa7113_cleanup);
+module_i2c_driver(wis_saa7113_driver);
 
 MODULE_L

[PATCH] dvb-frontends: fix potential NULL pointer dereference in stv0900_set_mclk()

2012-10-08 Thread Wei Yongjun
From: Wei Yongjun 

The dereference should be moved below the NULL test.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/dvb-frontends/stv0900_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-frontends/stv0900_core.c 
b/drivers/media/dvb-frontends/stv0900_core.c
index 7f1bada..274a71c 100644
--- a/drivers/media/dvb-frontends/stv0900_core.c
+++ b/drivers/media/dvb-frontends/stv0900_core.c
@@ -300,15 +300,15 @@ static enum fe_stv0900_error stv0900_set_mclk(struct 
stv0900_internal *intp, u32
 {
u32 m_div, clk_sel;
 
-   dprintk("%s: Mclk set to %d, Quartz = %d\n", __func__, mclk,
-   intp->quartz);
-
if (intp == NULL)
return STV0900_INVALID_HANDLE;
 
if (intp->errs)
return STV0900_I2C_ERROR;
 
+   dprintk("%s: Mclk set to %d, Quartz = %d\n", __func__, mclk,
+   intp->quartz);
+
clk_sel = ((stv0900_get_bits(intp, F0900_SELX1RATIO) == 1) ? 4 : 6);
m_div = ((clk_sel * mclk) / intp->quartz) - 1;
stv0900_write_bits(intp, F0900_M_DIV, m_div);

--
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] v4l2: use list_move_tail instead of list_del/list_add_tail

2012-10-08 Thread Wei Yongjun
From: Wei Yongjun 

Using list_move_tail() instead of list_del() + list_add_tail().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/fsl-viu.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
index 897250b..c5091fe 100644
--- a/drivers/media/platform/fsl-viu.c
+++ b/drivers/media/platform/fsl-viu.c
@@ -352,8 +352,7 @@ static int restart_video_queue(struct viu_dmaqueue *vidq)
return 0;
buf = list_entry(vidq->queued.next, struct viu_buf, vb.queue);
if (prev == NULL) {
-   list_del(&buf->vb.queue);
-   list_add_tail(&buf->vb.queue, &vidq->active);
+   list_move_tail(&buf->vb.queue, &vidq->active);
 
dprintk(1, "Restarting video dma\n");
viu_stop_dma(vidq->dev);
@@ -367,8 +366,7 @@ static int restart_video_queue(struct viu_dmaqueue *vidq)
} else if (prev->vb.width  == buf->vb.width  &&
   prev->vb.height == buf->vb.height &&
   prev->fmt   == buf->fmt) {
-   list_del(&buf->vb.queue);
-   list_add_tail(&buf->vb.queue, &vidq->active);
+   list_move_tail(&buf->vb.queue, &vidq->active);
buf->vb.state = VIDEOBUF_ACTIVE;
dprintk(2, "[%p/%d] restart_queue - move to active\n",
buf, buf->vb.i);

--
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] cx88: use list_move_tail instead of list_del/list_add_tail

2012-10-08 Thread Wei Yongjun
From: Wei Yongjun 

Using list_move_tail() instead of list_del() + list_add_tail().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/pci/cx88/cx88-mpeg.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/pci/cx88/cx88-mpeg.c 
b/drivers/media/pci/cx88/cx88-mpeg.c
index c04fb61..33f6f87 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -217,8 +217,7 @@ static int cx8802_restart_queue(struct cx8802_dev*dev,
return 0;
buf = list_entry(q->queued.next, struct cx88_buffer, 
vb.queue);
if (NULL == prev) {
-   list_del(&buf->vb.queue);
-   list_add_tail(&buf->vb.queue,&q->active);
+   list_move_tail(&buf->vb.queue, &q->active);
cx8802_start_dma(dev, q, buf);
buf->vb.state = VIDEOBUF_ACTIVE;
buf->count= q->count++;
@@ -229,8 +228,7 @@ static int cx8802_restart_queue(struct cx8802_dev*dev,
} else if (prev->vb.width  == buf->vb.width  &&
   prev->vb.height == buf->vb.height &&
   prev->fmt   == buf->fmt) {
-   list_del(&buf->vb.queue);
-   list_add_tail(&buf->vb.queue,&q->active);
+   list_move_tail(&buf->vb.queue, &q->active);
buf->vb.state = VIDEOBUF_ACTIVE;
buf->count= q->count++;
prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);

--
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] cx23885: use list_move_tail instead of list_del/list_add_tail

2012-10-08 Thread Wei Yongjun
From: Wei Yongjun 

Using list_move_tail() instead of list_del() + list_add_tail().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/pci/cx23885/cx23885-core.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/pci/cx23885/cx23885-core.c 
b/drivers/media/pci/cx23885/cx23885-core.c
index 697728f..4189d64 100644
--- a/drivers/media/pci/cx23885/cx23885-core.c
+++ b/drivers/media/pci/cx23885/cx23885-core.c
@@ -1516,8 +1516,7 @@ int cx23885_restart_queue(struct cx23885_tsport *port,
buf = list_entry(q->queued.next, struct cx23885_buffer,
 vb.queue);
if (NULL == prev) {
-   list_del(&buf->vb.queue);
-   list_add_tail(&buf->vb.queue, &q->active);
+   list_move_tail(&buf->vb.queue, &q->active);
cx23885_start_dma(port, q, buf);
buf->vb.state = VIDEOBUF_ACTIVE;
buf->count= q->count++;
@@ -1528,8 +1527,7 @@ int cx23885_restart_queue(struct cx23885_tsport *port,
} else if (prev->vb.width  == buf->vb.width  &&
   prev->vb.height == buf->vb.height &&
   prev->fmt   == buf->fmt) {
-   list_del(&buf->vb.queue);
-   list_add_tail(&buf->vb.queue, &q->active);
+   list_move_tail(&buf->vb.queue, &q->active);
buf->vb.state = VIDEOBUF_ACTIVE;
buf->count= q->count++;
prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);

--
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: remove unused including

2012-10-08 Thread Wei Yongjun
From: Wei Yongjun 

Remove including  that don't need it.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/s5p-tv/mixer_video.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/s5p-tv/mixer_video.c 
b/drivers/media/platform/s5p-tv/mixer_video.c
index 0c1cd89..9b52f3a 100644
--- a/drivers/media/platform/s5p-tv/mixer_video.c
+++ b/drivers/media/platform/s5p-tv/mixer_video.c
@@ -19,7 +19,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 

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