diff options
author | Sai Charan Gurrappadi <sgurrappadi@nvidia.com> | 2012-08-15 17:56:11 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 01:33:43 -0700 |
commit | b01ed6a12c9b6adfb0521ae912338769849a660f (patch) | |
tree | c5173b67ab4c88481bf929882420d7de449d52d2 /drivers/cpuquiet | |
parent | 3c3be5e319466178f4549039421eb8303c18b9d9 (diff) |
cpuquiet: Fix cpuquiet for k3.4
Change-Id: I75d8dba6c9c4c43152c819e08beeccb1e3c07c0c
Signed-off-by: Sai Charan Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/123850
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers/cpuquiet')
-rw-r--r-- | drivers/cpuquiet/cpuquiet.c | 2 | ||||
-rw-r--r-- | drivers/cpuquiet/cpuquiet.h | 6 | ||||
-rw-r--r-- | drivers/cpuquiet/driver.c | 11 | ||||
-rw-r--r-- | drivers/cpuquiet/governors/balanced.c | 2 | ||||
-rw-r--r-- | drivers/cpuquiet/sysfs.c | 8 |
5 files changed, 14 insertions, 15 deletions
diff --git a/drivers/cpuquiet/cpuquiet.c b/drivers/cpuquiet/cpuquiet.c index d902af26c8d7..a0f36c32bb05 100644 --- a/drivers/cpuquiet/cpuquiet.c +++ b/drivers/cpuquiet/cpuquiet.c @@ -26,7 +26,7 @@ DEFINE_MUTEX(cpuquiet_lock); static int __init cpuquiet_init(void) { - return cpuquiet_add_class_sysfs(&cpu_sysdev_class); + return cpuquiet_add_interface(cpu_subsys.dev_root); } core_initcall(cpuquiet_init); diff --git a/drivers/cpuquiet/cpuquiet.h b/drivers/cpuquiet/cpuquiet.h index fa61946ff119..bf5af94cdd7d 100644 --- a/drivers/cpuquiet/cpuquiet.h +++ b/drivers/cpuquiet/cpuquiet.h @@ -19,17 +19,17 @@ #ifndef __DRIVER_CPUQUIET_H #define __DRIVER_CPUQUIET_H -#include <linux/sysdev.h> +#include <linux/device.h> extern struct mutex cpuquiet_lock; extern struct cpuquiet_governor *cpuquiet_curr_governor; extern struct list_head cpuquiet_governors; -int cpuquiet_add_class_sysfs(struct sysdev_class *cls); +int cpuquiet_add_interface(struct device *dev); struct cpuquiet_governor *cpuquiet_find_governor(const char *str); int cpuquiet_switch_governor(struct cpuquiet_governor *gov); struct cpuquiet_governor *cpuquiet_get_first_governor(void); struct cpuquiet_driver *cpuquiet_get_driver(void); -void cpuquiet_add_dev(struct sys_device *sys_dev, unsigned int cpu); +void cpuquiet_add_dev(struct device *dev, unsigned int cpu); void cpuquiet_remove_dev(unsigned int cpu); int cpuquiet_cpu_kobject_init(struct kobject *kobj, struct kobj_type *type, char *name, int cpu); diff --git a/drivers/cpuquiet/driver.c b/drivers/cpuquiet/driver.c index d9dbea76994a..4b888fa97be2 100644 --- a/drivers/cpuquiet/driver.c +++ b/drivers/cpuquiet/driver.c @@ -62,8 +62,7 @@ static void stats_update(struct cpuquiet_cpu_stat *stat, bool up) bool was_up = stat->up_down_count & 0x1; if (was_up) - stat->time_up_total = cputime64_add(stat->time_up_total, - cputime64_sub(cur_jiffies, stat->last_update)); + stat->time_up_total += cur_jiffies - stat->last_update; if (was_up != up) stat->up_down_count++; @@ -136,7 +135,7 @@ int cpuquiet_register_driver(struct cpuquiet_driver *drv) { int err = -EBUSY; unsigned int cpu; - struct sys_device *sys_dev; + struct device *dev; u64 cur_jiffies; if (!drv) @@ -151,9 +150,9 @@ int cpuquiet_register_driver(struct cpuquiet_driver *drv) stats[cpu].last_update = cur_jiffies; if (cpu_online(cpu)) stats[cpu].up_down_count = 1; - sys_dev = get_cpu_sysdev(cpu); - if (sys_dev) { - cpuquiet_add_dev(sys_dev, cpu); + dev = get_cpu_device(cpu); + if (dev) { + cpuquiet_add_dev(dev, cpu); cpuquiet_cpu_kobject_init(&stats[cpu].cpu_kobject, &ktype_cpu_stats, "stats", cpu); } diff --git a/drivers/cpuquiet/governors/balanced.c b/drivers/cpuquiet/governors/balanced.c index f0d2e03ae22b..61dd2cb1009a 100644 --- a/drivers/cpuquiet/governors/balanced.c +++ b/drivers/cpuquiet/governors/balanced.c @@ -21,7 +21,7 @@ #include <linux/cpumask.h> #include <linux/module.h> #include <linux/cpufreq.h> -#include <linux/pm_qos_params.h> +#include <linux/pm_qos.h> #include <linux/jiffies.h> #include <linux/slab.h> #include <linux/cpu.h> diff --git a/drivers/cpuquiet/sysfs.c b/drivers/cpuquiet/sysfs.c index 0d63eee37dce..c3ae097bd56d 100644 --- a/drivers/cpuquiet/sysfs.c +++ b/drivers/cpuquiet/sysfs.c @@ -180,7 +180,7 @@ int cpuquiet_cpu_kobject_init(struct kobject *kobj, struct kobj_type *type, return err; } -int cpuquiet_add_class_sysfs(struct sysdev_class *cls) +int cpuquiet_add_interface(struct device *dev) { int err; @@ -190,7 +190,7 @@ int cpuquiet_add_class_sysfs(struct sysdev_class *cls) return -ENOMEM; err = kobject_init_and_add(cpuquiet_global_kobject, - &ktype_cpuquiet_sysfs, &cls->kset.kobj, "cpuquiet"); + &ktype_cpuquiet_sysfs, &dev->kobj, "cpuquiet"); if (!err) kobject_uevent(cpuquiet_global_kobject, KOBJ_ADD); @@ -270,7 +270,7 @@ static struct kobj_type ktype_cpuquiet = { .default_attrs = cpuquiet_default_cpu_attrs, }; -void cpuquiet_add_dev(struct sys_device *sys_dev, unsigned int cpu) +void cpuquiet_add_dev(struct device *device, unsigned int cpu) { struct cpuquiet_dev *dev; int err; @@ -279,7 +279,7 @@ void cpuquiet_add_dev(struct sys_device *sys_dev, unsigned int cpu) dev->cpu = cpu; cpuquiet_cpu_devices[cpu] = dev; err = kobject_init_and_add(&dev->kobj, &ktype_cpuquiet, - &sys_dev->kobj, "cpuquiet"); + &device->kobj, "cpuquiet"); if (!err) kobject_uevent(&dev->kobj, KOBJ_ADD); } |