mediasync: remove the printk in media sync [1/1]
authorLifeng Cao <lifeng.cao@amlogic.com>
Tue, 27 Oct 2020 09:47:12 +0000 (17:47 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Wed, 28 Oct 2020 08:04:43 +0000 (01:04 -0700)
PD#SWPL-35599

Problem:
mediasync has too many print in kernel

Solution:
remove the printk in media sync

Verify:
ah212

Change-Id: I633d31c5df3f7a2b464ce1bb49e381216b0b8498
Signed-off-by: Lifeng Cao <lifeng.cao@amlogic.com>
drivers/media_sync/media_sync_core.c
drivers/media_sync/media_sync_dev.c

index 28cb965fe1d46f26ad1d644f3c40cd0b0fa262d3..0bc03bfde54156eb018f35306b558f574d67f460 100644 (file)
@@ -55,6 +55,9 @@ static u64 get_stc_time_us(s32 sSyncInsId)
        pInstance = vMediaSyncInsList[index];
        ktime_get_ts64(&ts_monotonic);
        timeus = ts_monotonic.tv_sec * 1000000LL + ts_monotonic.tv_nsec / 1000LL;
+       if (pInstance->mDemuxId < 0)
+               return timeus;
+
        ret = demux_get_pcr(pInstance->mDemuxId, 0, &pcr);
        if (ret != 0) {
                stc = timeus;
@@ -82,7 +85,7 @@ static u64 get_stc_time_us(s32 sSyncInsId)
                        }
                }
        }
-       printk("get_stc_time_us stc:%lld pcr:%lld system_time:%lld\n", stc,  pcr * 100 / 9,  timeus);
+       pr_debug("get_stc_time_us stc:%lld pcr:%lld system_time:%lld\n", stc,  pcr * 100 / 9,  timeus);
        return stc;
 }
 
@@ -91,7 +94,7 @@ static s64 get_system_time_us(void) {
        struct timespec64 ts_monotonic;
        ktime_get_ts64(&ts_monotonic);
        TimeUs = ts_monotonic.tv_sec * 1000000LL + ts_monotonic.tv_nsec / 1000LL;
-       printk("get_system_time_us %lld\n", TimeUs);
+       pr_debug("get_system_time_us %lld\n", TimeUs);
        return TimeUs;
 }
 
@@ -111,7 +114,7 @@ long mediasync_ins_alloc(s32 sDemuxId,
                        vMediaSyncInsList[index] = pInstance;
                        pInstance->mSyncInsId = index;
                        *sSyncInsId = index;
-                       printk("mediasync_ins_alloc index:%d\n", index);
+                       pr_info("mediasync_ins_alloc index:%d\n", index);
                        break;
                }
        }
@@ -209,7 +212,7 @@ long mediasync_ins_update_mediatime(s32 sSyncInsId,
                        if (diff_mediatime < 0
                                || ((diff_mediatime > 0)
                                && (get_llabs(diff_system_time - diff_mediatime) > MIN_UPDATETIME_THRESHOLD_US ))) {
-                               printk("MEDIA_SYNC_PCRMASTER update time");
+                               pr_info("MEDIA_SYNC_PCRMASTER update time\n");
                                pInstance->mLastMediaTime = lMediaTime;
                                pInstance->mLastRealTime = current_systemtime;
                                pInstance->mLastStc = current_stc;
index dec8adc67898aae0a2c3406ff8e2367d39733bb5..c2f224f13c8a6dfb6be402fcdf804eddddbffdee 100644 (file)
@@ -98,7 +98,7 @@ static long mediasync_ioctl(struct file *file, unsigned int cmd, ulong arg)
        mediasync_priv_s *priv = (mediasync_priv_s *)file->private_data;
        mediasync_ins *SyncIns = NULL;
        mediasync_alloc_para parm = {0};
-    mediasync_arthortime_para ArthorTime = {0};
+       mediasync_arthortime_para ArthorTime = {0};
        mediasync_updatetime_para UpdateTime = {0};
        mediasync_systime_para SystemTime = {0};
        switch (cmd) {