mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
To: Mike Turquette <mturquette@linaro.org>
Cc: "Stephen Boyd" <sboyd@codeaurora.org>,
	"Tomeu Vizoso" <tomeu.vizoso@collabora.com>,
	"Emilio López" <emilio@elopez.com.ar>,
	"Peter De Schrijver" <pdeschrijver@nvidia.com>,
	"Robert Jarzmik" <robert.jarzmik@free.fr>,
	"Giuseppe Cavallaro" <peppe.cavallaro@st.com>,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Javier Martinez Canillas" <javier.martinez@collabora.co.uk>
Subject: [PATCH v2 2/3] clk: Add __clk_hw_set_clk helper function
Date: Thu, 12 Feb 2015 14:58:29 +0100	[thread overview]
Message-ID: <1423749510-14525-3-git-send-email-javier.martinez@collabora.co.uk> (raw)
In-Reply-To: <1423749510-14525-1-git-send-email-javier.martinez@collabora.co.uk>

After the clk API change to return a per-user clock instance, both the
struct clk_core and struct clk pointers from the hw clock needs to be
assigned to clock that share the same state.

In the future the struct clk_core will be removed and this is going to
change again so to avoid having to change the assignments twice in all
the drivers, add a helper function to have an indirection level.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---

Changes since v1: None, new patch.
---
 include/linux/clk-provider.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 17dd6e9439d1..5591ea71a8d1 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -590,6 +590,12 @@ long __clk_mux_determine_rate_closest(struct clk_hw *hw, unsigned long rate,
 			      unsigned long *best_parent_rate,
 			      struct clk_hw **best_parent_p);
 
+static inline void __clk_hw_set_clk(struct clk_hw *dst, struct clk_hw *src)
+{
+	dst->clk = src->clk;
+	dst->core = src->core;
+}
+
 /*
  * FIXME clock api without lock protection
  */
-- 
2.1.3


  parent reply	other threads:[~2015-02-12 13:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12 13:58 [PATCH v2 0/3] clk: Some fixes for the per-user clk API changes Javier Martinez Canillas
2015-02-12 13:58 ` [PATCH v2 1/3] clk: Don't dereference parent clock if is NULL Javier Martinez Canillas
2015-02-12 19:00   ` Stephen Boyd
2015-02-12 13:58 ` Javier Martinez Canillas [this message]
2015-02-12 19:55   ` [PATCH v2 2/3] clk: Add __clk_hw_set_clk helper function Stephen Boyd
2015-02-13  7:28     ` Javier Martinez Canillas
2015-02-12 13:58 ` [PATCH v2 3/3] clk: Replace explicit clk assignment with __clk_hw_set_clk Javier Martinez Canillas
2015-02-12 16:12   ` Robert Jarzmik
2015-02-12 19:55   ` Stephen Boyd
2015-02-13  7:23     ` Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423749510-14525-3-git-send-email-javier.martinez@collabora.co.uk \
    --to=javier.martinez@collabora.co.uk \
    --cc=emilio@elopez.com.ar \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=pdeschrijver@nvidia.com \
    --cc=peppe.cavallaro@st.com \
    --cc=robert.jarzmik@free.fr \
    --cc=sboyd@codeaurora.org \
    --cc=tomeu.vizoso@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®