* [PATCH] OMAP PM: Remove symbol exports
@ 2009-10-27 19:49 Paul Walmsley
2009-10-27 21:04 ` Kevin Hilman
0 siblings, 1 reply; 2+ messages in thread
From: Paul Walmsley @ 2009-10-27 19:49 UTC (permalink / raw)
To: linux-omap; +Cc: ameya.palande, khilman
This patch applies against the PM branch.
Commit b32960d2fd88085d6270c4f3a2f708e7ce42cd7b exported many of the
functions from the OMAP PM layer, presumably to allow device drivers
to call them directly. This ties the device drivers to the OMAP
platform; they will not compile or work on other platforms, e.g.,
DaVinci. Device driver code should be platform-independent. This
patch removes the EXPORT_SYMBOL() lines.
Rather than relying on exported symbols, device drivers should instead
pass pointers to these functions via function pointers in struct
platform_device.platform_data. Then the device driver code should use
an idiom similar to:
if (pdata->function_name)
pdata->function_name(arg1, arg2, ...);
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Ameya Palande <ameya.palande@nokia.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
---
arch/arm/plat-omap/omap-pm-noop.c | 7 -------
arch/arm/plat-omap/omap-pm-srf.c | 7 -------
2 files changed, 0 insertions(+), 14 deletions(-)
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c
index d3c7279..cab105f 100644
--- a/arch/arm/plat-omap/omap-pm-noop.c
+++ b/arch/arm/plat-omap/omap-pm-noop.c
@@ -157,7 +157,6 @@ const struct omap_opp *omap_pm_dsp_get_opp_table(void)
return NULL;
}
-EXPORT_SYMBOL(omap_pm_dsp_get_opp_table);
void omap_pm_dsp_set_min_opp(u8 opp_id)
{
@@ -182,7 +181,6 @@ void omap_pm_dsp_set_min_opp(u8 opp_id)
*
*/
}
-EXPORT_SYMBOL(omap_pm_dsp_set_min_opp);
u8 omap_pm_dsp_get_opp(void)
{
@@ -198,7 +196,6 @@ u8 omap_pm_dsp_get_opp(void)
return 0;
}
-EXPORT_SYMBOL(omap_pm_dsp_get_opp);
u8 omap_pm_vdd1_get_opp(void)
{
@@ -210,7 +207,6 @@ u8 omap_pm_vdd1_get_opp(void)
return 0;
}
-EXPORT_SYMBOL(omap_pm_vdd1_get_opp);
u8 omap_pm_vdd2_get_opp(void)
{
@@ -222,7 +218,6 @@ u8 omap_pm_vdd2_get_opp(void)
return 0;
}
-EXPORT_SYMBOL(omap_pm_vdd2_get_opp);
/*
* CPUFreq-originated constraint
@@ -263,7 +258,6 @@ void omap_pm_cpu_set_freq(unsigned long f)
* CDP should just be able to set the VDD1 OPP clock rate here.
*/
}
-EXPORT_SYMBOL(omap_pm_cpu_set_freq);
unsigned long omap_pm_cpu_get_freq(void)
{
@@ -275,7 +269,6 @@ unsigned long omap_pm_cpu_get_freq(void)
return 0;
}
-EXPORT_SYMBOL(omap_pm_cpu_get_freq);
/*
* Device context loss tracking
diff --git a/arch/arm/plat-omap/omap-pm-srf.c b/arch/arm/plat-omap/omap-pm-srf.c
index a28945b..d769b90 100644
--- a/arch/arm/plat-omap/omap-pm-srf.c
+++ b/arch/arm/plat-omap/omap-pm-srf.c
@@ -185,7 +185,6 @@ const struct omap_opp *omap_pm_dsp_get_opp_table(void)
return NULL;
}
-EXPORT_SYMBOL(omap_pm_dsp_get_opp_table);
void omap_pm_dsp_set_min_opp(u8 opp_id)
{
@@ -203,28 +202,24 @@ void omap_pm_dsp_set_min_opp(u8 opp_id)
resource_request("vdd1_opp", &dummy_dsp_dev, opp_id);
return;
}
-EXPORT_SYMBOL(omap_pm_dsp_set_min_opp);
u8 omap_pm_dsp_get_opp(void)
{
pr_debug("OMAP PM: DSP requests current DSP OPP ID\n");
return resource_get_level("vdd1_opp");
}
-EXPORT_SYMBOL(omap_pm_dsp_get_opp);
u8 omap_pm_vdd1_get_opp(void)
{
pr_debug("OMAP PM: User requests current VDD1 OPP\n");
return resource_get_level("vdd1_opp");
}
-EXPORT_SYMBOL(omap_pm_vdd1_get_opp);
u8 omap_pm_vdd2_get_opp(void)
{
pr_debug("OMAP PM: User requests current VDD2 OPP\n");
return resource_get_level("vdd2_opp");
}
-EXPORT_SYMBOL(omap_pm_vdd2_get_opp);
/*
* CPUFreq-originated constraint
@@ -261,14 +256,12 @@ void omap_pm_cpu_set_freq(unsigned long f)
resource_request("mpu_freq", &dummy_cpufreq_dev, f);
return;
}
-EXPORT_SYMBOL(omap_pm_cpu_set_freq);
unsigned long omap_pm_cpu_get_freq(void)
{
pr_debug("OMAP PM: CPUFreq requests current CPU frequency\n");
return resource_get_level("mpu_freq");
}
-EXPORT_SYMBOL(omap_pm_cpu_get_freq);
/*
* Device context loss tracking
--
1.6.5.GIT
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] OMAP PM: Remove symbol exports
2009-10-27 19:49 [PATCH] OMAP PM: Remove symbol exports Paul Walmsley
@ 2009-10-27 21:04 ` Kevin Hilman
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Hilman @ 2009-10-27 21:04 UTC (permalink / raw)
To: Paul Walmsley; +Cc: linux-omap, ameya.palande
Paul Walmsley <paul@pwsan.com> writes:
> This patch applies against the PM branch.
>
> Commit b32960d2fd88085d6270c4f3a2f708e7ce42cd7b exported many of the
> functions from the OMAP PM layer, presumably to allow device drivers
> to call them directly. This ties the device drivers to the OMAP
> platform; they will not compile or work on other platforms, e.g.,
> DaVinci. Device driver code should be platform-independent. This
> patch removes the EXPORT_SYMBOL() lines.
>
> Rather than relying on exported symbols, device drivers should instead
> pass pointers to these functions via function pointers in struct
> platform_device.platform_data. Then the device driver code should use
> an idiom similar to:
>
> if (pdata->function_name)
> pdata->function_name(arg1, arg2, ...);
>
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> Cc: Ameya Palande <ameya.palande@nokia.com>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
Thanks, pushing to PM branch. On the next rebase, I'll just drop the
commit(s) that added the exports.
Kevin
> ---
> arch/arm/plat-omap/omap-pm-noop.c | 7 -------
> arch/arm/plat-omap/omap-pm-srf.c | 7 -------
> 2 files changed, 0 insertions(+), 14 deletions(-)
>
> diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c
> index d3c7279..cab105f 100644
> --- a/arch/arm/plat-omap/omap-pm-noop.c
> +++ b/arch/arm/plat-omap/omap-pm-noop.c
> @@ -157,7 +157,6 @@ const struct omap_opp *omap_pm_dsp_get_opp_table(void)
>
> return NULL;
> }
> -EXPORT_SYMBOL(omap_pm_dsp_get_opp_table);
>
> void omap_pm_dsp_set_min_opp(u8 opp_id)
> {
> @@ -182,7 +181,6 @@ void omap_pm_dsp_set_min_opp(u8 opp_id)
> *
> */
> }
> -EXPORT_SYMBOL(omap_pm_dsp_set_min_opp);
>
> u8 omap_pm_dsp_get_opp(void)
> {
> @@ -198,7 +196,6 @@ u8 omap_pm_dsp_get_opp(void)
>
> return 0;
> }
> -EXPORT_SYMBOL(omap_pm_dsp_get_opp);
>
> u8 omap_pm_vdd1_get_opp(void)
> {
> @@ -210,7 +207,6 @@ u8 omap_pm_vdd1_get_opp(void)
>
> return 0;
> }
> -EXPORT_SYMBOL(omap_pm_vdd1_get_opp);
>
> u8 omap_pm_vdd2_get_opp(void)
> {
> @@ -222,7 +218,6 @@ u8 omap_pm_vdd2_get_opp(void)
>
> return 0;
> }
> -EXPORT_SYMBOL(omap_pm_vdd2_get_opp);
>
> /*
> * CPUFreq-originated constraint
> @@ -263,7 +258,6 @@ void omap_pm_cpu_set_freq(unsigned long f)
> * CDP should just be able to set the VDD1 OPP clock rate here.
> */
> }
> -EXPORT_SYMBOL(omap_pm_cpu_set_freq);
>
> unsigned long omap_pm_cpu_get_freq(void)
> {
> @@ -275,7 +269,6 @@ unsigned long omap_pm_cpu_get_freq(void)
>
> return 0;
> }
> -EXPORT_SYMBOL(omap_pm_cpu_get_freq);
>
> /*
> * Device context loss tracking
> diff --git a/arch/arm/plat-omap/omap-pm-srf.c b/arch/arm/plat-omap/omap-pm-srf.c
> index a28945b..d769b90 100644
> --- a/arch/arm/plat-omap/omap-pm-srf.c
> +++ b/arch/arm/plat-omap/omap-pm-srf.c
> @@ -185,7 +185,6 @@ const struct omap_opp *omap_pm_dsp_get_opp_table(void)
>
> return NULL;
> }
> -EXPORT_SYMBOL(omap_pm_dsp_get_opp_table);
>
> void omap_pm_dsp_set_min_opp(u8 opp_id)
> {
> @@ -203,28 +202,24 @@ void omap_pm_dsp_set_min_opp(u8 opp_id)
> resource_request("vdd1_opp", &dummy_dsp_dev, opp_id);
> return;
> }
> -EXPORT_SYMBOL(omap_pm_dsp_set_min_opp);
>
> u8 omap_pm_dsp_get_opp(void)
> {
> pr_debug("OMAP PM: DSP requests current DSP OPP ID\n");
> return resource_get_level("vdd1_opp");
> }
> -EXPORT_SYMBOL(omap_pm_dsp_get_opp);
>
> u8 omap_pm_vdd1_get_opp(void)
> {
> pr_debug("OMAP PM: User requests current VDD1 OPP\n");
> return resource_get_level("vdd1_opp");
> }
> -EXPORT_SYMBOL(omap_pm_vdd1_get_opp);
>
> u8 omap_pm_vdd2_get_opp(void)
> {
> pr_debug("OMAP PM: User requests current VDD2 OPP\n");
> return resource_get_level("vdd2_opp");
> }
> -EXPORT_SYMBOL(omap_pm_vdd2_get_opp);
>
> /*
> * CPUFreq-originated constraint
> @@ -261,14 +256,12 @@ void omap_pm_cpu_set_freq(unsigned long f)
> resource_request("mpu_freq", &dummy_cpufreq_dev, f);
> return;
> }
> -EXPORT_SYMBOL(omap_pm_cpu_set_freq);
>
> unsigned long omap_pm_cpu_get_freq(void)
> {
> pr_debug("OMAP PM: CPUFreq requests current CPU frequency\n");
> return resource_get_level("mpu_freq");
> }
> -EXPORT_SYMBOL(omap_pm_cpu_get_freq);
>
> /*
> * Device context loss tracking
> --
> 1.6.5.GIT
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-27 21:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-27 19:49 [PATCH] OMAP PM: Remove symbol exports Paul Walmsley
2009-10-27 21:04 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox