All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: lantiq: add clk_round_rate()
@ 2015-10-25 22:21 Hauke Mehrtens
  2015-10-26  6:56 ` John Crispin
  2015-10-26 10:50 ` Sergei Shtylyov
  0 siblings, 2 replies; 3+ messages in thread
From: Hauke Mehrtens @ 2015-10-25 22:21 UTC (permalink / raw)
  To: ralf; +Cc: blogic, linux-mips, Hauke Mehrtens, # 4 . 1+

This adds a basic implementation of clk_round_rate()
The clk_round_rate() function is called by multiple drivers and
subsystems now and the lantiq clk driver is supposed to export this,
but doesn't do so, this causes linking problems like this one:
ERROR: "clk_round_rate" [drivers/media/v4l2-core/videodev.ko] undefined!

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: <stable@vger.kernel.org> # 4.1+
---
 arch/mips/lantiq/clk.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/mips/lantiq/clk.c b/arch/mips/lantiq/clk.c
index 3fc2e6d..a0706fd 100644
--- a/arch/mips/lantiq/clk.c
+++ b/arch/mips/lantiq/clk.c
@@ -99,6 +99,23 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 }
 EXPORT_SYMBOL(clk_set_rate);
 
+long clk_round_rate(struct clk *clk, unsigned long rate)
+{
+	if (unlikely(!clk_good(clk)))
+		return 0;
+	if (clk->rates && *clk->rates) {
+		unsigned long *r = clk->rates;
+
+		while (*r && (*r != rate))
+			r++;
+		if (!*r) {
+			return clk->rate;
+		}
+	}
+	return rate;
+}
+EXPORT_SYMBOL(clk_round_rate);
+
 int clk_enable(struct clk *clk)
 {
 	if (unlikely(!clk_good(clk)))
-- 
2.6.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: lantiq: add clk_round_rate()
  2015-10-25 22:21 [PATCH] MIPS: lantiq: add clk_round_rate() Hauke Mehrtens
@ 2015-10-26  6:56 ` John Crispin
  2015-10-26 10:50 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: John Crispin @ 2015-10-26  6:56 UTC (permalink / raw)
  To: linux-mips



On 25/10/2015 23:21, Hauke Mehrtens wrote:
> This adds a basic implementation of clk_round_rate()
> The clk_round_rate() function is called by multiple drivers and
> subsystems now and the lantiq clk driver is supposed to export this,
> but doesn't do so, this causes linking problems like this one:
> ERROR: "clk_round_rate" [drivers/media/v4l2-core/videodev.ko] undefined!
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> Cc: <stable@vger.kernel.org> # 4.1+

Acked-by: John Crispin <blogic@openwrt.org>




> ---
>  arch/mips/lantiq/clk.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/arch/mips/lantiq/clk.c b/arch/mips/lantiq/clk.c
> index 3fc2e6d..a0706fd 100644
> --- a/arch/mips/lantiq/clk.c
> +++ b/arch/mips/lantiq/clk.c
> @@ -99,6 +99,23 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
>  }
>  EXPORT_SYMBOL(clk_set_rate);
>  
> +long clk_round_rate(struct clk *clk, unsigned long rate)
> +{
> +	if (unlikely(!clk_good(clk)))
> +		return 0;
> +	if (clk->rates && *clk->rates) {
> +		unsigned long *r = clk->rates;
> +
> +		while (*r && (*r != rate))
> +			r++;
> +		if (!*r) {
> +			return clk->rate;
> +		}
> +	}
> +	return rate;
> +}
> +EXPORT_SYMBOL(clk_round_rate);
> +
>  int clk_enable(struct clk *clk)
>  {
>  	if (unlikely(!clk_good(clk)))
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: lantiq: add clk_round_rate()
  2015-10-25 22:21 [PATCH] MIPS: lantiq: add clk_round_rate() Hauke Mehrtens
  2015-10-26  6:56 ` John Crispin
@ 2015-10-26 10:50 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2015-10-26 10:50 UTC (permalink / raw)
  To: Hauke Mehrtens, ralf; +Cc: blogic, linux-mips, # 4 . 1+

Hello.

On 10/26/2015 1:21 AM, Hauke Mehrtens wrote:

> This adds a basic implementation of clk_round_rate()
> The clk_round_rate() function is called by multiple drivers and
> subsystems now and the lantiq clk driver is supposed to export this,
> but doesn't do so, this causes linking problems like this one:
> ERROR: "clk_round_rate" [drivers/media/v4l2-core/videodev.ko] undefined!
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> Cc: <stable@vger.kernel.org> # 4.1+
> ---
>   arch/mips/lantiq/clk.c | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
>
> diff --git a/arch/mips/lantiq/clk.c b/arch/mips/lantiq/clk.c
> index 3fc2e6d..a0706fd 100644
> --- a/arch/mips/lantiq/clk.c
> +++ b/arch/mips/lantiq/clk.c
> @@ -99,6 +99,23 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
>   }
>   EXPORT_SYMBOL(clk_set_rate);
>
> +long clk_round_rate(struct clk *clk, unsigned long rate)
> +{
> +	if (unlikely(!clk_good(clk)))
> +		return 0;
> +	if (clk->rates && *clk->rates) {
> +		unsigned long *r = clk->rates;
> +
> +		while (*r && (*r != rate))
> +			r++;
> +		if (!*r) {
> +			return clk->rate;
> +		}

    {} not needed here.

[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-26 10:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-25 22:21 [PATCH] MIPS: lantiq: add clk_round_rate() Hauke Mehrtens
2015-10-26  6:56 ` John Crispin
2015-10-26 10:50 ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.