LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: [PATCH v2] PM / devfreq: tegra: Register governor on module init
@ 2015-03-31  2:16 MyungJoo Ham
  0 siblings, 0 replies; 2+ messages in thread
From: MyungJoo Ham @ 2015-03-31  2:16 UTC (permalink / raw)
  To: Tomeu Vizoso, linux-kernel
  Cc: linux-tegra, 박경민,
	Stephen Warren, Thierry Reding, Alexandre Courbot, linux-pm

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 719 bytes --]

> Sender : Tomeu Vizoso<tomeu.vizoso@collabora.com>
> Date : 2015-03-31 00:33 (GMT+09:00)
> Title : [PATCH v2] PM / devfreq: tegra: Register governor on module init
> 
> So this driver builds as a module.
> 
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> ---
> 
> v2: * Remove governor if driver registration fails
> ---
> drivers/devfreq/tegra-devfreq.c | 37 ++++++++++++++++++++++++++++++-------
> 1 file changed, 30 insertions(+), 7 deletions(-)
> 

Thanks. Merged.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>


Cheers,
MyungJoo.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* [PATCH v2] PM / devfreq: tegra: Register governor on module init
  2015-03-30 15:08 [PATCH] " Thierry Reding
@ 2015-03-30 15:33 ` Tomeu Vizoso
  0 siblings, 0 replies; 2+ messages in thread
From: Tomeu Vizoso @ 2015-03-30 15:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-tegra, Tomeu Vizoso, MyungJoo Ham, Kyungmin Park,
	Stephen Warren, Thierry Reding, Alexandre Courbot, linux-pm

So this driver builds as a module.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

v2:	* Remove governor if driver registration fails
---
 drivers/devfreq/tegra-devfreq.c | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c
index 8e633a6..13a1a6e 100644
--- a/drivers/devfreq/tegra-devfreq.c
+++ b/drivers/devfreq/tegra-devfreq.c
@@ -606,12 +606,6 @@ static struct devfreq_governor tegra_devfreq_governor = {
 	.event_handler = tegra_governor_event_handler,
 };
 
-static int __init tegra_governor_init(void)
-{
-	return devfreq_add_governor(&tegra_devfreq_governor);
-}
-subsys_initcall(tegra_governor_init);
-
 static int tegra_devfreq_probe(struct platform_device *pdev)
 {
 	struct tegra_devfreq *tegra;
@@ -755,7 +749,36 @@ static struct platform_driver tegra_devfreq_driver = {
 		.of_match_table = tegra_devfreq_of_match,
 	},
 };
-module_platform_driver(tegra_devfreq_driver);
+
+static int __init tegra_devfreq_init(void)
+{
+	int ret = 0;
+
+	ret = devfreq_add_governor(&tegra_devfreq_governor);
+	if (ret) {
+		pr_err("%s: failed to add governor: %d\n", __func__, ret);
+		return ret;
+	}
+
+	ret = platform_driver_register(&tegra_devfreq_driver);
+	if (ret)
+		devfreq_remove_governor(&tegra_devfreq_governor);
+
+	return ret;
+}
+module_init(tegra_devfreq_init)
+
+static void __exit tegra_devfreq_exit(void)
+{
+	int ret = 0;
+
+	platform_driver_unregister(&tegra_devfreq_driver);
+
+	ret = devfreq_remove_governor(&tegra_devfreq_governor);
+	if (ret)
+		pr_err("%s: failed to remove governor: %d\n", __func__, ret);
+}
+module_exit(tegra_devfreq_exit)
 
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("Tegra devfreq driver");
-- 
2.1.0


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

end of thread, other threads:[~2015-03-31  2:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-31  2:16 [PATCH v2] PM / devfreq: tegra: Register governor on module init MyungJoo Ham
  -- strict thread matches above, loose matches on Subject: below --
2015-03-30 15:08 [PATCH] " Thierry Reding
2015-03-30 15:33 ` [PATCH v2] " Tomeu Vizoso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).