aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/devfreq/devfreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/devfreq/devfreq.c')
-rw-r--r--drivers/devfreq/devfreq.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index ca1b362d77e2..ca848cc6a8fd 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -53,7 +53,7 @@ static struct devfreq *find_device_devfreq(struct device *dev)
53{ 53{
54 struct devfreq *tmp_devfreq; 54 struct devfreq *tmp_devfreq;
55 55
56 if (unlikely(IS_ERR_OR_NULL(dev))) { 56 if (IS_ERR_OR_NULL(dev)) {
57 pr_err("DEVFREQ: %s: Invalid parameters\n", __func__); 57 pr_err("DEVFREQ: %s: Invalid parameters\n", __func__);
58 return ERR_PTR(-EINVAL); 58 return ERR_PTR(-EINVAL);
59 } 59 }
@@ -133,7 +133,7 @@ static struct devfreq_governor *find_devfreq_governor(const char *name)
133{ 133{
134 struct devfreq_governor *tmp_governor; 134 struct devfreq_governor *tmp_governor;
135 135
136 if (unlikely(IS_ERR_OR_NULL(name))) { 136 if (IS_ERR_OR_NULL(name)) {
137 pr_err("DEVFREQ: %s: Invalid parameters\n", __func__); 137 pr_err("DEVFREQ: %s: Invalid parameters\n", __func__);
138 return ERR_PTR(-EINVAL); 138 return ERR_PTR(-EINVAL);
139 } 139 }
@@ -177,10 +177,10 @@ int update_devfreq(struct devfreq *devfreq)
177 return err; 177 return err;
178 178
179 /* 179 /*
180 * Adjust the freuqency with user freq and QoS. 180 * Adjust the frequency with user freq and QoS.
181 * 181 *
182 * List from the highest proiority 182 * List from the highest priority
183 * max_freq (probably called by thermal when it's too hot) 183 * max_freq
184 * min_freq 184 * min_freq
185 */ 185 */
186 186
@@ -482,7 +482,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
482 devfreq->profile->max_state * 482 devfreq->profile->max_state *
483 devfreq->profile->max_state, 483 devfreq->profile->max_state,
484 GFP_KERNEL); 484 GFP_KERNEL);
485 devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned int) * 485 devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned long) *
486 devfreq->profile->max_state, 486 devfreq->profile->max_state,
487 GFP_KERNEL); 487 GFP_KERNEL);
488 devfreq->last_stat_updated = jiffies; 488 devfreq->last_stat_updated = jiffies;
@@ -492,7 +492,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
492 if (err) { 492 if (err) {
493 put_device(&devfreq->dev); 493 put_device(&devfreq->dev);
494 mutex_unlock(&devfreq->lock); 494 mutex_unlock(&devfreq->lock);
495 goto err_dev; 495 goto err_out;
496 } 496 }
497 497
498 mutex_unlock(&devfreq->lock); 498 mutex_unlock(&devfreq->lock);
@@ -518,7 +518,6 @@ struct devfreq *devfreq_add_device(struct device *dev,
518err_init: 518err_init:
519 list_del(&devfreq->node); 519 list_del(&devfreq->node);
520 device_unregister(&devfreq->dev); 520 device_unregister(&devfreq->dev);
521err_dev:
522 kfree(devfreq); 521 kfree(devfreq);
523err_out: 522err_out:
524 return ERR_PTR(err); 523 return ERR_PTR(err);
@@ -795,8 +794,10 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr,
795 ret = PTR_ERR(governor); 794 ret = PTR_ERR(governor);
796 goto out; 795 goto out;
797 } 796 }
798 if (df->governor == governor) 797 if (df->governor == governor) {
798 ret = 0;
799 goto out; 799 goto out;
800 }
800 801
801 if (df->governor) { 802 if (df->governor) {
802 ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL); 803 ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL);