msm: clock-local: Make .is_local assignments optional

Rather than forcing the assignment of the is_local clock op for all clock
types, consider clocks with a NULL is_local function pointer as local
by default. This allows for the removal of local_clk_is_local() and
dummy_clk_is_local(), which always returned true.

Change-Id: Ib5f275acf3dec5c2a0e57243d32dd357b936d26b
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/clock-7x30.c b/arch/arm/mach-msm/clock-7x30.c
index e3447b8..b4b2855 100644
--- a/arch/arm/mach-msm/clock-7x30.c
+++ b/arch/arm/mach-msm/clock-7x30.c
@@ -2653,7 +2653,6 @@
 static struct clk_ops measure_clk_ops = {
 	.set_parent = measure_clk_set_parent,
 	.get_rate = measure_clk_get_rate,
-	.is_local = local_clk_is_local,
 };
 
 static struct clk measure_clk = {
@@ -3024,7 +3023,6 @@
 	.round_rate = rcg_clk_round_rate,
 	.reset = msm7x30_clk_reset,
 	.set_flags = soc_clk_set_flags,
-	.is_local = local_clk_is_local,
 	.get_parent = rcg_clk_get_parent,
 };
 
@@ -3035,6 +3033,5 @@
 	.is_enabled = branch_clk_is_enabled,
 	.reset = soc_branch_clk_reset,
 	.set_flags = soc_clk_set_flags,
-	.is_local = local_clk_is_local,
 	.get_parent = branch_clk_get_parent,
 };
diff --git a/arch/arm/mach-msm/clock-8960.c b/arch/arm/mach-msm/clock-8960.c
index 3c06f98..7828d64 100644
--- a/arch/arm/mach-msm/clock-8960.c
+++ b/arch/arm/mach-msm/clock-8960.c
@@ -565,7 +565,6 @@
 	.is_enabled = rcg_clk_is_enabled,
 	.round_rate = rcg_clk_round_rate,
 	.reset = rcg_clk_reset,
-	.is_local = local_clk_is_local,
 	.get_parent = rcg_clk_get_parent,
 	.set_flags = rcg_clk_set_flags,
 };
@@ -579,7 +578,6 @@
 	.auto_off = branch_clk_disable,
 	.is_enabled = branch_clk_is_enabled,
 	.reset = branch_clk_reset,
-	.is_local = local_clk_is_local,
 	.get_parent = branch_clk_get_parent,
 	.handoff = branch_clk_handoff,
 	.set_flags = branch_clk_set_flags,
@@ -587,7 +585,6 @@
 
 static struct clk_ops clk_ops_reset = {
 	.reset = branch_clk_reset,
-	.is_local = local_clk_is_local,
 };
 
 /* AXI Interfaces */
@@ -2892,7 +2889,6 @@
 	.get_rate = pix_rdi_clk_get_rate,
 	.list_rate = pix_rdi_clk_list_rate,
 	.reset = pix_rdi_clk_reset,
-	.is_local = local_clk_is_local,
 	.get_parent = pix_rdi_clk_get_parent,
 };
 
@@ -3823,7 +3819,6 @@
 	.enable = hdmi_pll_clk_enable,
 	.disable = hdmi_pll_clk_disable,
 	.get_rate = hdmi_pll_clk_get_rate,
-	.is_local = local_clk_is_local,
 	.get_parent = hdmi_pll_clk_get_parent,
 };
 
@@ -4893,7 +4888,6 @@
 static struct clk_ops measure_clk_ops = {
 	.set_parent = measure_clk_set_parent,
 	.get_rate = measure_clk_get_rate,
-	.is_local = local_clk_is_local,
 };
 
 static struct measure_clk measure_clk = {
diff --git a/arch/arm/mach-msm/clock-8x60.c b/arch/arm/mach-msm/clock-8x60.c
index 771a4bf..ad8c936 100644
--- a/arch/arm/mach-msm/clock-8x60.c
+++ b/arch/arm/mach-msm/clock-8x60.c
@@ -439,7 +439,6 @@
 	.is_enabled = rcg_clk_is_enabled,
 	.round_rate = rcg_clk_round_rate,
 	.reset = rcg_clk_reset,
-	.is_local = local_clk_is_local,
 	.get_parent = rcg_clk_get_parent,
 	.set_flags = rcg_clk_set_flags,
 };
@@ -450,14 +449,12 @@
 	.auto_off = branch_clk_disable,
 	.is_enabled = branch_clk_is_enabled,
 	.reset = branch_clk_reset,
-	.is_local = local_clk_is_local,
 	.get_parent = branch_clk_get_parent,
 	.set_flags = branch_clk_set_flags,
 };
 
 static struct clk_ops clk_ops_reset = {
 	.reset = branch_clk_reset,
-	.is_local = local_clk_is_local,
 };
 
 /*
@@ -3481,7 +3478,6 @@
 static struct clk_ops measure_clk_ops = {
 	.set_parent = measure_clk_set_parent,
 	.get_rate = measure_clk_get_rate,
-	.is_local = local_clk_is_local,
 };
 
 static struct measure_clk measure_clk = {
diff --git a/arch/arm/mach-msm/clock-9615.c b/arch/arm/mach-msm/clock-9615.c
index 48ee4a9..a2ebe50 100644
--- a/arch/arm/mach-msm/clock-9615.c
+++ b/arch/arm/mach-msm/clock-9615.c
@@ -248,7 +248,6 @@
 	.auto_off = pll_acpu_vote_clk_disable,
 	.is_enabled = pll_vote_clk_is_enabled,
 	.get_parent = pll_vote_clk_get_parent,
-	.is_local = local_clk_is_local,
 };
 
 #define PLL_SOFT_VOTE_PRIMARY	BIT(0)
@@ -372,7 +371,6 @@
 	.is_enabled = rcg_clk_is_enabled,
 	.round_rate = rcg_clk_round_rate,
 	.reset = rcg_clk_reset,
-	.is_local = local_clk_is_local,
 	.get_parent = rcg_clk_get_parent,
 };
 
@@ -386,7 +384,6 @@
 	.handoff = branch_clk_handoff,
 	.is_enabled = branch_clk_is_enabled,
 	.reset = branch_clk_reset,
-	.is_local = local_clk_is_local,
 	.get_parent = branch_clk_get_parent,
 };
 
@@ -1585,7 +1582,6 @@
 static struct clk_ops measure_clk_ops = {
 	.set_parent = measure_clk_set_parent,
 	.get_rate = measure_clk_get_rate,
-	.is_local = local_clk_is_local,
 };
 
 static struct measure_clk measure_clk = {
diff --git a/arch/arm/mach-msm/clock-debug.c b/arch/arm/mach-msm/clock-debug.c
index 31be6af..54b13e6 100644
--- a/arch/arm/mach-msm/clock-debug.c
+++ b/arch/arm/mach-msm/clock-debug.c
@@ -120,7 +120,10 @@
 {
 	struct clk *clock = data;
 
-	*val = clock->ops->is_local(clock);
+	if (!clock->ops->is_local)
+		*val = true;
+	else
+		*val = clock->ops->is_local(clock);
 
 	return 0;
 }
diff --git a/arch/arm/mach-msm/clock-dummy.c b/arch/arm/mach-msm/clock-dummy.c
index dfd4a67..54c9de8 100644
--- a/arch/arm/mach-msm/clock-dummy.c
+++ b/arch/arm/mach-msm/clock-dummy.c
@@ -42,11 +42,6 @@
 	return rate;
 }
 
-static bool dummy_clk_is_local(struct clk *clk)
-{
-	return true;
-}
-
 static struct clk_ops clk_ops_dummy = {
 	.reset = dummy_clk_reset,
 	.set_rate = dummy_clk_set_rate,
@@ -54,7 +49,6 @@
 	.set_flags = dummy_clk_set_flags,
 	.get_rate = dummy_clk_get_rate,
 	.round_rate = dummy_clk_round_rate,
-	.is_local = dummy_clk_is_local,
 };
 
 struct clk dummy_clk = {
diff --git a/arch/arm/mach-msm/clock-local.c b/arch/arm/mach-msm/clock-local.c
index f990998..84aa086 100644
--- a/arch/arm/mach-msm/clock-local.c
+++ b/arch/arm/mach-msm/clock-local.c
@@ -545,11 +545,6 @@
 	return -EPERM;
 }
 
-bool local_clk_is_local(struct clk *clk)
-{
-	return true;
-}
-
 /* Return the nth supported frequency for a given clock. */
 int rcg_clk_list_rate(struct clk *c, unsigned n)
 {
@@ -682,7 +677,6 @@
 	.auto_off = pll_vote_clk_disable,
 	.is_enabled = pll_vote_clk_is_enabled,
 	.get_parent = pll_vote_clk_get_parent,
-	.is_local = local_clk_is_local,
 };
 
 static int pll_clk_enable(struct clk *clk)
@@ -783,11 +777,9 @@
 	.disable = pll_clk_disable,
 	.auto_off = pll_clk_disable,
 	.get_parent = pll_clk_get_parent,
-	.is_local = local_clk_is_local,
 };
 
 struct clk_ops clk_ops_gnd = {
-	.is_local = local_clk_is_local,
 };
 
 struct fixed_clk gnd_clk = {
@@ -799,7 +791,6 @@
 };
 
 struct clk_ops clk_ops_measure = {
-	.is_local = local_clk_is_local,
 };
 
 int branch_clk_enable(struct clk *clk)
@@ -1099,5 +1090,4 @@
 	.get_rate = cdiv_clk_get_rate,
 	.list_rate = cdiv_clk_list_rate,
 	.round_rate = cdiv_clk_round_rate,
-	.is_local = local_clk_is_local,
 };
diff --git a/arch/arm/mach-msm/clock-local.h b/arch/arm/mach-msm/clock-local.h
index bc9298f..3dd849a 100644
--- a/arch/arm/mach-msm/clock-local.h
+++ b/arch/arm/mach-msm/clock-local.h
@@ -365,11 +365,6 @@
 extern struct fixed_clk		gnd_clk;
 
 /*
- * Local-clock APIs
- */
-bool local_clk_is_local(struct clk *clk);
-
-/*
  * PLL vote clock APIs
  */
 int pll_vote_clk_enable(struct clk *clk);