Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq into pm-devfreq
Pull devfreq fixes for v4.7 from MyungJoo Ham. * 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq: PM / devfreq: fix initialization of current frequency in last status PM / devfreq: exynos-nocp: Remove incorrect IS_ERR() check PM / devfreq: remove double put_device PM / devfreq: fix double call put_device PM / devfreq: fix duplicated kfree on devfreq pointer PM / devfreq: devm_kzalloc to have dev pointer more precisely
This commit is contained in:
commit
492a19ef8b
@ -552,6 +552,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
|
|||||||
devfreq->profile = profile;
|
devfreq->profile = profile;
|
||||||
strncpy(devfreq->governor_name, governor_name, DEVFREQ_NAME_LEN);
|
strncpy(devfreq->governor_name, governor_name, DEVFREQ_NAME_LEN);
|
||||||
devfreq->previous_freq = profile->initial_freq;
|
devfreq->previous_freq = profile->initial_freq;
|
||||||
|
devfreq->last_status.current_frequency = profile->initial_freq;
|
||||||
devfreq->data = data;
|
devfreq->data = data;
|
||||||
devfreq->nb.notifier_call = devfreq_notifier_call;
|
devfreq->nb.notifier_call = devfreq_notifier_call;
|
||||||
|
|
||||||
@ -561,23 +562,22 @@ struct devfreq *devfreq_add_device(struct device *dev,
|
|||||||
mutex_lock(&devfreq->lock);
|
mutex_lock(&devfreq->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
devfreq->trans_table = devm_kzalloc(dev, sizeof(unsigned int) *
|
|
||||||
devfreq->profile->max_state *
|
|
||||||
devfreq->profile->max_state,
|
|
||||||
GFP_KERNEL);
|
|
||||||
devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned long) *
|
|
||||||
devfreq->profile->max_state,
|
|
||||||
GFP_KERNEL);
|
|
||||||
devfreq->last_stat_updated = jiffies;
|
|
||||||
|
|
||||||
dev_set_name(&devfreq->dev, "%s", dev_name(dev));
|
dev_set_name(&devfreq->dev, "%s", dev_name(dev));
|
||||||
err = device_register(&devfreq->dev);
|
err = device_register(&devfreq->dev);
|
||||||
if (err) {
|
if (err) {
|
||||||
put_device(&devfreq->dev);
|
|
||||||
mutex_unlock(&devfreq->lock);
|
mutex_unlock(&devfreq->lock);
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
devfreq->trans_table = devm_kzalloc(&devfreq->dev, sizeof(unsigned int) *
|
||||||
|
devfreq->profile->max_state *
|
||||||
|
devfreq->profile->max_state,
|
||||||
|
GFP_KERNEL);
|
||||||
|
devfreq->time_in_state = devm_kzalloc(&devfreq->dev, sizeof(unsigned long) *
|
||||||
|
devfreq->profile->max_state,
|
||||||
|
GFP_KERNEL);
|
||||||
|
devfreq->last_stat_updated = jiffies;
|
||||||
|
|
||||||
srcu_init_notifier_head(&devfreq->transition_notifier_list);
|
srcu_init_notifier_head(&devfreq->transition_notifier_list);
|
||||||
|
|
||||||
mutex_unlock(&devfreq->lock);
|
mutex_unlock(&devfreq->lock);
|
||||||
@ -603,7 +603,6 @@ struct devfreq *devfreq_add_device(struct device *dev,
|
|||||||
err_init:
|
err_init:
|
||||||
list_del(&devfreq->node);
|
list_del(&devfreq->node);
|
||||||
device_unregister(&devfreq->dev);
|
device_unregister(&devfreq->dev);
|
||||||
kfree(devfreq);
|
|
||||||
err_out:
|
err_out:
|
||||||
return ERR_PTR(err);
|
return ERR_PTR(err);
|
||||||
}
|
}
|
||||||
@ -621,7 +620,6 @@ int devfreq_remove_device(struct devfreq *devfreq)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
device_unregister(&devfreq->dev);
|
device_unregister(&devfreq->dev);
|
||||||
put_device(&devfreq->dev);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -220,9 +220,6 @@ static int exynos_nocp_parse_dt(struct platform_device *pdev,
|
|||||||
|
|
||||||
/* Maps the memory mapped IO to control nocp register */
|
/* Maps the memory mapped IO to control nocp register */
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (IS_ERR(res))
|
|
||||||
return PTR_ERR(res);
|
|
||||||
|
|
||||||
base = devm_ioremap_resource(dev, res);
|
base = devm_ioremap_resource(dev, res);
|
||||||
if (IS_ERR(base))
|
if (IS_ERR(base))
|
||||||
return PTR_ERR(base);
|
return PTR_ERR(base);
|
||||||
|
Loading…
Reference in New Issue
Block a user