atv_demod: Modify atv io ctrl and memory alloc for atv crash.

PD#165008: Modify atv io ctrl and memory alloc for atv crash.

Change-Id: Ib6aa737ffad5d155022ad276ecf16ce2a7537138
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
This commit is contained in:
nengwen.chen
2018-04-24 16:51:22 +08:00
committed by Yixun Lan
parent a7169fd161
commit 3aab13f88d
4 changed files with 10 additions and 13 deletions

View File

@@ -434,8 +434,7 @@ static int aml_atvdemod_probe(struct platform_device *pdev)
int size_io_reg = 0;
struct aml_atvdemod_device *dev = NULL;
dev = devm_kmalloc(&pdev->dev, sizeof(struct aml_atvdemod_device),
GFP_KERNEL);
dev = kzalloc(sizeof(struct aml_atvdemod_device), GFP_KERNEL);
if (!dev)
return -ENOMEM;
@@ -517,8 +516,7 @@ static int aml_atvdemod_probe(struct platform_device *pdev)
fail_register_v4l2:
fail_get_resource:
/*devm_kfree(&pdev->dev, dev->cls.name);*/
devm_kfree(&pdev->dev, dev);
kfree(dev);
pr_info("%s: fail.\n", __func__);
@@ -536,8 +534,7 @@ static int aml_atvdemod_remove(struct platform_device *pdev)
amlatvdemod_devp = NULL;
/*devm_kfree(&pdev->dev, dev->cls.name);*/
devm_kfree(&pdev->dev, dev);
kfree(dev);
pr_info("%s: OK.\n", __func__);

View File

@@ -1009,14 +1009,14 @@ static int v4l2_get_frontend(struct v4l2_frontend *v4l2_fe,
}
static int v4l2_frontend_set_mode(struct v4l2_frontend *v4l2_fe,
unsigned long params)
int params)
{
int ret = 0;
struct v4l2_frontend_private *fepriv = v4l2_fe->frontend_priv;
struct analog_demod_ops *analog_ops = NULL;
int priv_cfg = 0;
pr_dbg("%s: params = %ld.\n", __func__, params);
pr_dbg("%s: params = %d.\n", __func__, params);
fepriv->state = V4L2FE_STATE_IDLE;
@@ -1132,7 +1132,7 @@ static long v4l2_frontend_ioctl(struct file *filp, void *fh, bool valid_prio,
break;
case V4L2_SET_MODE: /* 0x566c */
ret = v4l2_frontend_set_mode(v4l2_fe, (unsigned long) arg);
ret = v4l2_frontend_set_mode(v4l2_fe, *((int *) arg));
break;
case V4L2_READ_STATUS:

View File

@@ -67,7 +67,7 @@
#define V4L2_SET_FRONTEND _IOW('V', 105, struct v4l2_analog_parameters)
#define V4L2_GET_FRONTEND _IOR('V', 106, struct v4l2_analog_parameters)
#define V4L2_GET_EVENT _IOR('V', 107, struct v4l2_frontend_event)
#define V4L2_SET_MODE _IO('V', 108)
#define V4L2_SET_MODE _IOW('V', 108, int)
#define V4L2_READ_STATUS _IOR('V', 109, enum v4l2_status)

View File

@@ -1171,7 +1171,7 @@ void audio_thd_det(void)
if (thd_flag == 0) {
thd_tmp_v += adec_rd_reg(OV_CNT_REPORT) & 0xffff;
pr_dbg("#0x12:0x%x\n", (adec_rd_reg(OV_CNT_REPORT) & 0xffff));
pr_info("#0x12:0x%x\n", (adec_rd_reg(OV_CNT_REPORT) & 0xffff));
if (thd_cnt == 15) {
thd_tmp_v /= 3;
if (thd_tmp_v > audio_thd_threshold1) {
@@ -1184,7 +1184,7 @@ void audio_thd_det(void)
} else if (thd_flag == 1) {
thd_tmp_v += adec_rd_reg(OV_CNT_REPORT) & 0xffff;
pr_dbg("#0x13:0x%x\n", (adec_rd_reg(OV_CNT_REPORT) & 0xffff));
pr_info("#0x13:0x%x\n", (adec_rd_reg(OV_CNT_REPORT) & 0xffff));
if (thd_cnt == 15) {
thd_tmp_v /= 3;
if (thd_tmp_v <= audio_thd_threshold2) {
@@ -1266,7 +1266,7 @@ void audio_mode_det(int mode)
last_stereo_flag = stereo_flag;
last_sap_flag = sap_flag;
pr_dbg("atvdemod_monitor_audio done ....\n");
pr_info("atvdemod_monitor_audio done ....\n");
}
}