2007-10-24 16:24:09

by Adrian Bunk

[permalink] [raw]
Subject: [2.6 patch] #if 0 cpufreq.c:cpufreq_get()

cpufreq.c:cpufreq_get() no longer has any user.

Signed-off-by: Adrian Bunk <[email protected]>

---

drivers/cpufreq/cpufreq.c | 2 ++
1 file changed, 2 insertions(+)

099a5401a3c0322177866d4ba4e791825fe921d4
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 5e626b1..d27c802 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1143,6 +1143,7 @@ static unsigned int __cpufreq_get(unsigned int cpu)
return (ret_freq);
}

+#if 0
/**
* cpufreq_get - get the current CPU frequency (in kHz)
* @cpu: CPU number
@@ -1170,6 +1171,7 @@ out:
return (ret_freq);
}
EXPORT_SYMBOL(cpufreq_get);
+#endif /* 0 */


/**


2007-10-24 16:54:44

by Russell King

[permalink] [raw]
Subject: Re: [2.6 patch] #if 0 cpufreq.c:cpufreq_get()

On Wed, Oct 24, 2007 at 06:23:12PM +0200, Adrian Bunk wrote:
> cpufreq.c:cpufreq_get() no longer has any user.

Your checking seems to be flawed.

drivers/video/sa1100fb.c: cpufreq_get(smp_processor_id()));
drivers/video/sa1100fb.c: pcd = get_pcd(var->pixclock, cpufreq_get(0));

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:

2007-10-24 16:57:58

by Arjan van de Ven

[permalink] [raw]
Subject: Re: [2.6 patch] #if 0 cpufreq.c:cpufreq_get()

On Wed, 24 Oct 2007 18:23:12 +0200
Adrian Bunk <[email protected]> wrote:

> cpufreq.c:cpufreq_get() no longer has any user.
>

it's... also a really bad/buggy interface... frquency is a per cpu
property for one, and constantly changing (esp in a multi-core world)
even depending on what other parts of the system are doing.

2007-10-24 16:59:29

by Adrian Bunk

[permalink] [raw]
Subject: Re: [2.6 patch] #if 0 cpufreq.c:cpufreq_get()

On Wed, Oct 24, 2007 at 05:32:45PM +0100, Russell King wrote:
> On Wed, Oct 24, 2007 at 06:23:12PM +0200, Adrian Bunk wrote:
> > cpufreq.c:cpufreq_get() no longer has any user.
>
> Your checking seems to be flawed.
>
> drivers/video/sa1100fb.c: cpufreq_get(smp_processor_id()));
> drivers/video/sa1100fb.c: pcd = get_pcd(var->pixclock, cpufreq_get(0));

Thanks for spotting this.

My mistake was that I thought this was handled by the following without
checking closer:

arch/arm/mach-sa1100/generic.c:unsigned int cpufreq_get(unsigned int cpu)
arch/arm/mach-sa1100/generic.c:EXPORT_SYMBOL(cpufreq_get);

> Russell King

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2007-10-24 17:29:06

by Russell King

[permalink] [raw]
Subject: Re: [2.6 patch] #if 0 cpufreq.c:cpufreq_get()

On Wed, Oct 24, 2007 at 09:38:39AM -0700, Arjan van de Ven wrote:
> On Wed, 24 Oct 2007 18:23:12 +0200
> Adrian Bunk <[email protected]> wrote:
>
> > cpufreq.c:cpufreq_get() no longer has any user.
> >
>
> it's... also a really bad/buggy interface... frquency is a per cpu
> property for one, and constantly changing (esp in a multi-core world)
> even depending on what other parts of the system are doing.

... and such an assumption which would make it impossible to use
the LCD controller on StrongARM-11x0 processors.

This is precisely why we have CPUFREQ - so that hardware which needs
to be re-timed when the CPU frequency changes can get notified of that
event and take the appropriate action. It exists. It works.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:

2007-10-24 18:40:01

by Dave Jones

[permalink] [raw]
Subject: Re: [2.6 patch] #if 0 cpufreq.c:cpufreq_get()

On Wed, Oct 24, 2007 at 06:23:12PM +0200, Adrian Bunk wrote:
> cpufreq.c:cpufreq_get() no longer has any user.
>
> Signed-off-by: Adrian Bunk <[email protected]>

ARM uses it.

drivers/pcmcia/sa11xx_base.c: return sa1100_pcmcia_set_mecr(skt, cpufreq_get(0));
drivers/pcmcia/sa11xx_base.c: unsigned int clock = cpufreq_get(0);
drivers/video/sa1100fb.c: cpufreq_get(smp_processor_id()));
drivers/video/sa1100fb.c: pcd = get_pcd(var->pixclock, cpufreq_get(0));

Dave

--
http://www.codemonkey.org.uk