summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSivaram Nair <sivaramn@nvidia.com>2012-09-13 17:06:14 +0300
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-09-18 05:54:27 -0700
commit071b55b3762b4770636f834b2f0d0ed7d4a0967d (patch)
tree2200e26c7433145a106422b8ecf58cb87cd311ca
parent2f42a335a5104b045c89f29d6314f0b46b11be04 (diff)
pm: EDP: bug fixes
This patch includes several minor bug fixes: (1) fixing example documentation (2) fixing minor errors in sysfs (3) fixing governor initcalls to postcore (4) adding missing include Change-Id: I3c1115cc23e6e887c083801a59143c5a06e75d12 Signed-off-by: Sivaram Nair <sivaramn@nvidia.com> Reviewed-on: http://git-master/r/132525 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
-rw-r--r--Documentation/edp/howto5
-rw-r--r--drivers/edp/edp_overage.c4
-rw-r--r--drivers/edp/edp_priority.c11
-rw-r--r--drivers/edp/sysfs.c12
-rw-r--r--include/linux/edp.h1
5 files changed, 14 insertions, 19 deletions
diff --git a/Documentation/edp/howto b/Documentation/edp/howto
index da8384894558..84335292d80d 100644
--- a/Documentation/edp/howto
+++ b/Documentation/edp/howto
@@ -147,10 +147,13 @@ examples show how the usual operations are performed.
Example 2:
+ static unsigned int modem_states[] = { ... }
+
/* modem client */
struct edp_client modem_edp_client = {
.name = "modem",
- .states = { 2500, 1500, 1000, 500, 0 },
+ .states = modem_states,
+ .num_states = ARRAY_SIZE(num_states),
.e0_index = MODEM_EDP_E0,
.priority = EDP_MAX_PRIO - 3,
.max_borrowers = 1,
diff --git a/drivers/edp/edp_overage.c b/drivers/edp/edp_overage.c
index fd7f841b5883..8f379aaea714 100644
--- a/drivers/edp/edp_overage.c
+++ b/drivers/edp/edp_overage.c
@@ -239,6 +239,4 @@ static int __init overage_init(void)
{
return edp_register_governor(&overage_governor);
}
-
-MODULE_LICENSE("GPL");
-module_init(overage_init);
+postcore_initcall(overage_init);
diff --git a/drivers/edp/edp_priority.c b/drivers/edp/edp_priority.c
index bb78e7ea9369..b2396e3d57c9 100644
--- a/drivers/edp/edp_priority.c
+++ b/drivers/edp/edp_priority.c
@@ -163,13 +163,4 @@ static int __init prio_init(void)
{
return edp_register_governor(&prio_governor);
}
-
-static void __exit prio_exit(void)
-{
- int r = edp_unregister_governor(&prio_governor);
- WARN_ON(r);
-}
-
-MODULE_LICENSE("GPL");
-module_init(prio_init);
-module_exit(prio_exit);
+postcore_initcall(prio_init);
diff --git a/drivers/edp/sysfs.c b/drivers/edp/sysfs.c
index e22fccf06cdc..d23996bc7ac9 100644
--- a/drivers/edp/sysfs.c
+++ b/drivers/edp/sysfs.c
@@ -221,7 +221,8 @@ static ssize_t current_show(struct edp_client *c, char *s)
static ssize_t threshold_show(struct edp_client *c, char *s)
{
- return scnprintf(s, PAGE_SIZE, "%u\n", c->ithreshold);
+ return scnprintf(s, PAGE_SIZE, "%u\n",
+ c->num_loans ? c->ithreshold : 0);
}
static ssize_t borrowers_show(struct edp_client *c, char *s)
@@ -240,10 +241,13 @@ struct client_attr attr_e0 = __ATTR_RO(e0);
struct client_attr attr_max_borrowers = __ATTR_RO(max_borrowers);
struct client_attr attr_priority = __ATTR_RO(priority);
struct client_attr attr_request = __ATTR_RO(request);
-struct client_attr attr_current = __ATTR_RO(current);
struct client_attr attr_threshold = __ATTR_RO(threshold);
struct client_attr attr_borrowers = __ATTR_RO(borrowers);
struct client_attr attr_loans = __ATTR_RO(loans);
+struct client_attr attr_current = {
+ .attr = { .name = "current", .mode = 0444 },
+ .show = current_show
+};
static struct attribute *client_attrs[] = {
&attr_states.attr,
@@ -383,6 +387,4 @@ static int __init edp_sysfs_init(void)
return kobject_init_and_add(&edp_kobj, &ktype_edp, parent, "edp");
}
-
-MODULE_LICENSE("GPL");
-module_init(edp_sysfs_init);
+postcore_initcall(edp_sysfs_init);
diff --git a/include/linux/edp.h b/include/linux/edp.h
index ef114e70e0fe..fe11c8af284f 100644
--- a/include/linux/edp.h
+++ b/include/linux/edp.h
@@ -19,6 +19,7 @@
#include <linux/kernel.h>
#include <linux/errno.h>
+#include <linux/workqueue.h>
#define EDP_NAME_LEN 16
#define EDP_MIN_PRIO 0