Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9762c95b authored by Rajakumar Govindaram's avatar Rajakumar Govindaram Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera2: cpp: Setup timer once during probe



The setup_timer need not be called each and every time. We
can avoid it and use del_timer / mod_timer.

Change-Id: If1116b04b97eac732508c309d685ce37fe9a957d
Signed-off-by: default avatarRajakumar Govindaram <rajakuma@codeaurora.org>
parent f1637604
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1672,10 +1672,6 @@ static int msm_cpp_send_frame_to_hardware(struct cpp_device *cpp_dev,
			flags);
		if (queue_len == 1) {
			atomic_set(&cpp_timer.used, 1);
			/* install timer for cpp timeout */
			CPP_DBG("Installing cpp_timer\n");
			setup_timer(&cpp_timer.cpp_timer,
				cpp_timer_callback, (unsigned long)&cpp_timer);
		}
		CPP_DBG("Starting timer to fire in %d ms. (jiffies=%lu)\n",
			CPP_CMD_TIMEOUT_MS, jiffies);
@@ -3523,6 +3519,10 @@ static int cpp_probe(struct platform_device *pdev)
	cpp_dev->iommu_state = CPP_IOMMU_STATE_DETACHED;
	cpp_timer.data.cpp_dev = cpp_dev;
	atomic_set(&cpp_timer.used, 0);
	/* install timer for cpp timeout */
	CPP_DBG("Installing cpp_timer\n");
	setup_timer(&cpp_timer.cpp_timer,
		cpp_timer_callback, (unsigned long)&cpp_timer);
	cpp_dev->fw_name_bin = NULL;
	if (rc == 0)
		CPP_DBG("SUCCESS.");