[PATCH -next] [media] pulse8-cec: fix non static symbol warning

2016-07-13 Thread weiyj_lk
From: Wei Yongjun 

Fixes the following sparse warning:

drivers/staging/media/pulse8-cec/pulse8-cec.c:427:27: warning:
 symbol 'pulse8_cec_adap_ops' was not declared. Should it be static?

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

diff --git a/drivers/staging/media/pulse8-cec/pulse8-cec.c 
b/drivers/staging/media/pulse8-cec/pulse8-cec.c
index 7d6d5ee..94f8590 100644
--- a/drivers/staging/media/pulse8-cec/pulse8-cec.c
+++ b/drivers/staging/media/pulse8-cec/pulse8-cec.c
@@ -424,7 +424,7 @@ static int pulse8_received(struct cec_adapter *adap, struct 
cec_msg *msg)
return -ENOMSG;
 }
 
-const struct cec_adap_ops pulse8_cec_adap_ops = {
+static const struct cec_adap_ops pulse8_cec_adap_ops = {
.adap_enable = pulse8_cec_adap_enable,
.adap_log_addr = pulse8_cec_adap_log_addr,
.adap_transmit = pulse8_cec_adap_transmit,


--
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] rcar_vin: remove redundant return value check of platform_get_resource()

2016-07-12 Thread weiyj_lk
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(). And move those two call together
to make the connection between them more clear.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/soc_camera/rcar_vin.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/media/platform/soc_camera/rcar_vin.c 
b/drivers/media/platform/soc_camera/rcar_vin.c
index 9c13752..bf52262 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -1888,10 +1888,6 @@ static int rcar_vin_probe(struct platform_device *pdev)
 
dev_dbg(>dev, "pdata_flags = %08x\n", pdata_flags);
 
-   mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (mem == NULL)
-   return -EINVAL;
-
irq = platform_get_irq(pdev, 0);
if (irq <= 0)
return -EINVAL;
@@ -1901,6 +1897,7 @@ static int rcar_vin_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
 
+   mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->base = devm_ioremap_resource(>dev, mem);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);


--
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] mtk-vcodec: remove .owner field for driver

2016-07-12 Thread weiyj_lk
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/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 1 -
 1 file changed, 1 deletion(-)

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 9c10cc2..60b0bde 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
@@ -430,7 +430,6 @@ static struct platform_driver mtk_vcodec_enc_driver = {
.remove = mtk_vcodec_enc_remove,
.driver = {
.name   = MTK_VCODEC_ENC_NAME,
-   .owner  = THIS_MODULE,
.of_match_table = mtk_vcodec_enc_match,
},
 };


--
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 redundant return value check of platform_get_resource()

2016-07-12 Thread weiyj_lk
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/s5p-mfc/s5p_mfc.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index e3f104f..83a47d6 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1158,10 +1158,6 @@ static int s5p_mfc_probe(struct platform_device *pdev)
dev->variant = mfc_get_drv_data(pdev);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (res == NULL) {
-   dev_err(>dev, "failed to get io resource\n");
-   return -ENOENT;
-   }
dev->regs_base = devm_ioremap_resource(>dev, res);
if (IS_ERR(dev->regs_base))
return PTR_ERR(dev->regs_base);


--
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] rcar_jpu: Add missing clk_disable_unprepare() on error in jpu_open()

2016-07-12 Thread weiyj_lk
From: Wei Yongjun 

Add the missing clk_disable_unprepare() before return from
jpu_open() in the software reset error handling case.

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

diff --git a/drivers/media/platform/rcar_jpu.c 
b/drivers/media/platform/rcar_jpu.c
index 16782ce..8e6c617 100644
--- a/drivers/media/platform/rcar_jpu.c
+++ b/drivers/media/platform/rcar_jpu.c
@@ -1280,7 +1280,7 @@ static int jpu_open(struct file *file)
/* ...issue software reset */
ret = jpu_reset(jpu);
if (ret)
-   goto device_prepare_rollback;
+   goto jpu_reset_rollback;
}
 
jpu->ref_count++;
@@ -1288,6 +1288,8 @@ static int jpu_open(struct file *file)
mutex_unlock(>mutex);
return 0;
 
+jpu_reset_rollback:
+   clk_disable_unprepare(jpu->clk);
 device_prepare_rollback:
mutex_unlock(>mutex);
 v4l_prepare_rollback:


--
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] vcodec: mediatek: Fix return value check in mtk_vcodec_init_enc_pm()

2016-07-12 Thread weiyj_lk
From: Wei Yongjun 

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

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c 
b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
index 2379e97..3e73e9d 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
@@ -67,27 +67,27 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev)
pm->dev = >dev;
 
pm->vencpll_d2 = devm_clk_get(>dev, "venc_sel_src");
-   if (pm->vencpll_d2 == NULL) {
+   if (IS_ERR(pm->vencpll_d2)) {
mtk_v4l2_err("devm_clk_get vencpll_d2 fail");
-   ret = -1;
+   ret = PTR_ERR(pm->vencpll_d2);
}
 
pm->venc_sel = devm_clk_get(>dev, "venc_sel");
-   if (pm->venc_sel == NULL) {
+   if (IS_ERR(pm->venc_sel)) {
mtk_v4l2_err("devm_clk_get venc_sel fail");
-   ret = -1;
+   ret = PTR_ERR(pm->venc_sel);
}
 
pm->univpll1_d2 = devm_clk_get(>dev, "venc_lt_sel_src");
-   if (pm->univpll1_d2 == NULL) {
+   if (IS_ERR(pm->univpll1_d2)) {
mtk_v4l2_err("devm_clk_get univpll1_d2 fail");
-   ret = -1;
+   ret = PTR_ERR(pm->univpll1_d2);
}
 
pm->venc_lt_sel = devm_clk_get(>dev, "venc_lt_sel");
-   if (pm->venc_lt_sel == NULL) {
+   if (IS_ERR(pm->venc_lt_sel)) {
mtk_v4l2_err("devm_clk_get venc_lt_sel fail");
-   ret = -1;
+   ret = PTR_ERR(pm->venc_lt_sel);
}
 
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] mtk-vcodec: remove redundant dev_err call in mtk_vcodec_probe()

2016-07-12 Thread weiyj_lk
From: Wei Yongjun 

There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Signed-off-by: Wei Yongjun 
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 2 --
 1 file changed, 2 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 9c10cc2..b33a931 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
@@ -279,8 +279,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
}
dev->reg_base[i] = devm_ioremap_resource(>dev, res);
if (IS_ERR((__force void *)dev->reg_base[i])) {
-   dev_err(>dev,
-   "devm_ioremap_resource %d failed.", i);
ret = PTR_ERR((__force void *)dev->reg_base[i]);
goto err_res;
}


--
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] VPU: mediatek: fix return value check in mtk_vpu_probe()

2016-07-12 Thread weiyj_lk
From: Wei Yongjun 

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

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

diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c 
b/drivers/media/platform/mtk-vpu/mtk_vpu.c
index b60d02c..c8b2c72 100644
--- a/drivers/media/platform/mtk-vpu/mtk_vpu.c
+++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c
@@ -788,9 +788,9 @@ static int mtk_vpu_probe(struct platform_device *pdev)
 
/* Get VPU clock */
vpu->clk = devm_clk_get(dev, "main");
-   if (!vpu->clk) {
+   if (IS_ERR(vpu->clk)) {
dev_err(dev, "get vpu clock failed\n");
-   return -EINVAL;
+   return PTR_ERR(vpu->clk);
}
 
platform_set_drvdata(pdev, vpu);


--
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] VPU: mediatek: remove redundant dev_err call in mtk_vpu_probe()

2016-07-12 Thread weiyj_lk
From: Wei Yongjun 

There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

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

diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c 
b/drivers/media/platform/mtk-vpu/mtk_vpu.c
index b60d02c..532d2a4 100644
--- a/drivers/media/platform/mtk-vpu/mtk_vpu.c
+++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c
@@ -774,17 +774,13 @@ static int mtk_vpu_probe(struct platform_device *pdev)
vpu->dev = >dev;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "tcm");
vpu->reg.tcm = devm_ioremap_resource(dev, res);
-   if (IS_ERR((__force void *)vpu->reg.tcm)) {
-   dev_err(dev, "devm_ioremap_resource vpu tcm failed.\n");
+   if (IS_ERR((__force void *)vpu->reg.tcm))
return PTR_ERR((__force void *)vpu->reg.tcm);
-   }
 
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg_reg");
vpu->reg.cfg = devm_ioremap_resource(dev, res);
-   if (IS_ERR((__force void *)vpu->reg.cfg)) {
-   dev_err(dev, "devm_ioremap_resource vpu cfg failed.\n");
+   if (IS_ERR((__force void *)vpu->reg.cfg))
return PTR_ERR((__force void *)vpu->reg.cfg);
-   }
 
/* Get VPU clock */
vpu->clk = devm_clk_get(dev, "main");


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

2015-04-16 Thread weiyj_lk
From: Wei Yongjun yongjun_...@trendmicro.com.cn

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 yongjun_...@trendmicro.com.cn
---
 drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c 
b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index 87fc0fe..1723407 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -1176,7 +1176,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter 
*adap)
 rtl2832_sdr,
 PLATFORM_DEVID_AUTO,
 pdata, sizeof(pdata));
-   if (pdev == NULL || pdev-dev.driver == NULL)
+   if (IS_ERR(pdev) || pdev-dev.driver == NULL)
break;
dev-platform_device_sdr = pdev;
break;

--
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: dt3155v4l: remove unused including linux/version.h

2015-04-16 Thread weiyj_lk
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Remove including linux/version.h that don't need it.

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/staging/media/dt3155v4l/dt3155v4l.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c 
b/drivers/staging/media/dt3155v4l/dt3155v4l.c
index e60a53e..7946ee0 100644
--- a/drivers/staging/media/dt3155v4l/dt3155v4l.c
+++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c
@@ -19,7 +19,6 @@
  ***/
 
 #include linux/module.h
-#include linux/version.h
 #include linux/stringify.h
 #include linux/delay.h
 #include linux/kthread.h

--
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: remove unused including linux/version.h

2015-02-27 Thread weiyj_lk
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Remove including linux/version.h that don't need it.

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c 
b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
index 536210b..6489db8 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
@@ -21,7 +21,6 @@
 
 #include linux/kernel.h
 #include linux/slab.h
-#include linux/version.h
 #include pvrusb2-context.h
 #include pvrusb2-hdw.h
 #include pvrusb2.h

--
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-miropcm20: fix sparse NULL pointer warning

2014-07-29 Thread weiyj_lk
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Fixes the following sparse warnings:

drivers/media/radio/radio-miropcm20.c:193:33: warning:
 Using plain integer as NULL pointer

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/media/radio/radio-miropcm20.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/radio/radio-miropcm20.c 
b/drivers/media/radio/radio-miropcm20.c
index ac9915d..998919e 100644
--- a/drivers/media/radio/radio-miropcm20.c
+++ b/drivers/media/radio/radio-miropcm20.c
@@ -190,7 +190,7 @@ static int pcm20_setfreq(struct pcm20 *dev, unsigned long 
freq)
freql = freq  0xff;
freqh = freq  8;
 
-   rds_cmd(aci, RDS_RESET, 0, 0);
+   rds_cmd(aci, RDS_RESET, NULL, 0);
return snd_aci_cmd(aci, ACI_WRITE_TUNE, freql, freqh);
 }
 

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