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

Commit c3ac9b90 authored by Harsh Shah's avatar Harsh Shah
Browse files

msm: camera: Allow zero as valid input to enable_clk()



Currently enable_clk() returns error for 0 rate. But some modules may not
want to set a rate, only vote for the clock. Hence, 0 can be valid as input
parameter.
Also, modify the index of string to be read into src-clock-name.

Change-Id: Ie1d777b36fb5f5f26d1ad33586ec0ba69250969a
Signed-off-by: default avatarHarsh Shah <harshs@codeaurora.org>
parent 9d9d23fa
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ int cam_soc_util_clk_enable(struct clk *clk, const char *clk_name,
	int rc = 0;
	long clk_rate_round;

	if (!clk || !clk_name || !clk_rate)
	if (!clk || !clk_name)
		return -EINVAL;

	CDBG("enable %s, clk %pK rate %d\n",
@@ -231,8 +231,8 @@ static int cam_soc_util_get_dt_clk_info(struct cam_hw_soc_info *soc_info)
		return rc;
	}

	rc = of_property_read_string_index(of_node, "src-clock-name",
				i, &src_clk_str);
	rc = of_property_read_string_index(of_node, "src-clock-name", 0,
		&src_clk_str);
	if (rc) {
		CDBG("No src_clk_str found\n");
		soc_info->src_clk_idx = -1;