From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] cpufreq: exynos: allow modular build
Date: Wed, 28 Jan 2015 21:01:39 +0100 [thread overview]
Message-ID: <1799972.nQ2Axu0CEJ@wuerfel> (raw)
In-Reply-To: <20150128172209.GF29600@developer.hsd1.ca.comcast.net>
On Wednesday 28 January 2015 13:22:11 Eduardo Valentin wrote:
> >
> > config ARM_EXYNOS5440_CPUFREQ
> > - bool "SAMSUNG EXYNOS5440"
> > + tristate "SAMSUNG EXYNOS5440"
> > depends on SOC_EXYNOS5440
> > depends on HAVE_CLK && OF
> > + depends on THERMAL
> > select PM_OPP
> > default y
> > help
>
> Reading the code briefly, looks like the intention is to separate soc
> specific code into different files, but they all compose one single
> driver. Translating into module, I believe it makes sense to build them
> into a single module, instead of having all of them as separate module.
>
> Meaning, only ARM_EXYNOS_CPUFREQ becomes tristate, all the remaining
> continues bool. And we add the following Makefile change to your patch
That was my initial thought as well, but the devil is in the details:
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index 0f9a2c3..c3c3cf5 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -26,13 +26,19 @@ config ARM_VEXPRESS_SPC_CPUFREQ
>
>
> config ARM_EXYNOS_CPUFREQ
> - bool
> + tristate "SAMSUNG EXYNOS CPUfreq Driver"
> + depends on THERMAL
> + default y
> + help
> + This adds the CPUFreq driver for Samsung EXYNOS platforms
> +
> + If in doubt, say N.
Now the option shows up on all systems that include Kconfig.arm,
in particular non-exynos machines that might not even be able
to build this.
It's also enabled by default, but if you change the default to 'n',
the entire drivers will be disabled for users with an existing
configuration file.
We could work around these issues by adding extra (silent) Kconfig
symbols that automatically do the right thing, but that would not
be any less ugly than my first patch.
Another possible might be to change the drivers to use the normal
probe ordering and move the module_platform_driver() statement
into the individual drivers, so that e.g. exynos4210_cpufreq_init()
gets turned into exynos4210_cpufreq_probe() and calls the generic
exynos_cpufreq_probe() function. This would let us express the
dependencies more naturally and just export one symbol from the
main module.
Arnd
next prev parent reply other threads:[~2015-01-28 20:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-28 13:16 [PATCH 0/3] cpufreq: build fixes Arnd Bergmann
2015-01-28 13:16 ` [PATCH 1/3] cpufreq: s3c: remove incorrect __init annotations Arnd Bergmann
2015-01-29 3:23 ` Viresh Kumar
2015-01-28 13:16 ` [PATCH 2/3] cpufreq: s3c: remove last use of resume_clocks callback Arnd Bergmann
2015-01-29 3:23 ` Viresh Kumar
2015-01-28 13:16 ` [PATCH 3/3] cpufreq: exynos: allow modular build Arnd Bergmann
2015-01-28 17:22 ` Eduardo Valentin
2015-01-28 20:01 ` Arnd Bergmann [this message]
2015-01-29 3:39 ` Viresh Kumar
2015-01-29 10:01 ` Arnd Bergmann
2015-01-29 10:10 ` Viresh Kumar
2015-01-29 12:42 ` Arnd Bergmann
2015-01-29 22:21 ` Eduardo Valentin
2015-01-30 21:24 ` Arnd Bergmann
2015-01-30 21:51 ` Eduardo Valentin
2015-01-31 22:37 ` Arnd Bergmann
2015-01-30 0:58 ` [PATCH 0/3] cpufreq: build fixes Rafael J. Wysocki
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=1799972.nQ2Axu0CEJ@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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