Skip to content

Commit 031eda1

Browse files
committed
Merge tag 'devfreq-next-for-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux
Pull devfreq updates for v5.16 from Chanwoo Choi: "1. Minor update for exynos-ppmu devfreq-event driver - Devicetree naming convention requires the device node names to use hyphens instead of underlines. In order to support this requirement, changes the code with hyphens. - Simplify parsing event-type from devicetree without behavior changes. 2. Strengthen check for freq_table in devfreq core - Check whether both freq_table is not NULL and size of freq_table is not zero in order to prevent the error by mistake of devfreq driver developer. * tag 'devfreq-next-for-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux: PM / devfreq: Strengthen check for freq_table devfreq: exynos-ppmu: simplify parsing event-type from DT devfreq: exynos-ppmu: use node names with hyphens
2 parents 3906fe9 + 5cf79c2 commit 031eda1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

drivers/devfreq/devfreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
827827
goto err_dev;
828828
}
829829

830-
if (!devfreq->profile->max_state && !devfreq->profile->freq_table) {
830+
if (!devfreq->profile->max_state || !devfreq->profile->freq_table) {
831831
mutex_unlock(&devfreq->lock);
832832
err = set_freq_table(devfreq);
833833
if (err < 0)

drivers/devfreq/event/exynos-ppmu.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,16 @@ static struct __exynos_ppmu_events {
9494
PPMU_EVENT(d1-general),
9595
PPMU_EVENT(d1-rt),
9696

97-
/* For Exynos5422 SoC */
97+
/* For Exynos5422 SoC, deprecated (backwards compatible) */
9898
PPMU_EVENT(dmc0_0),
9999
PPMU_EVENT(dmc0_1),
100100
PPMU_EVENT(dmc1_0),
101101
PPMU_EVENT(dmc1_1),
102+
/* For Exynos5422 SoC */
103+
PPMU_EVENT(dmc0-0),
104+
PPMU_EVENT(dmc0-1),
105+
PPMU_EVENT(dmc1-0),
106+
PPMU_EVENT(dmc1-1),
102107
};
103108

104109
static int __exynos_ppmu_find_ppmu_id(const char *edev_name)
@@ -561,13 +566,10 @@ static int of_get_devfreq_events(struct device_node *np,
561566
* use default if not.
562567
*/
563568
if (info->ppmu_type == EXYNOS_TYPE_PPMU_V2) {
564-
int id;
565569
/* Not all registers take the same value for
566570
* read+write data count.
567571
*/
568-
id = __exynos_ppmu_find_ppmu_id(desc[j].name);
569-
570-
switch (id) {
572+
switch (ppmu_events[i].id) {
571573
case PPMU_PMNCNT0:
572574
case PPMU_PMNCNT1:
573575
case PPMU_PMNCNT2:

0 commit comments

Comments
 (0)