Skip to content

Commit 1471413

Browse files
krzkchanwoochoi
authored andcommitted
devfreq: exynos-ppmu: simplify parsing event-type from DT
When parsing devicetree, the function of_get_devfreq_events(), for each device child node, iterates over array of possible events "ppmu_events" till it finds one matching by node name. When match is found the ppmu_events[i] points to element having both the name of the event and the counters ID. Each PPMU device child node might have an "event-name" property with the name of the event, however due to the design of devfreq it must be the same as the device node name. If it is not the same, the devfreq client won't be able to use it via devfreq_event_get_edev_by_phandle(). Since PPMU device child node name must be equal to the "event-name" property (event-name == ppmu_events[i].name), there is no need to find the counters ID by the "event-name". Instead use ppmu_events[i].id which must be equal to it. Signed-off-by: Krzysztof Kozlowski <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent 28d7f0f commit 1471413

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/devfreq/event/exynos-ppmu.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,13 +566,10 @@ static int of_get_devfreq_events(struct device_node *np,
566566
* use default if not.
567567
*/
568568
if (info->ppmu_type == EXYNOS_TYPE_PPMU_V2) {
569-
int id;
570569
/* Not all registers take the same value for
571570
* read+write data count.
572571
*/
573-
id = __exynos_ppmu_find_ppmu_id(desc[j].name);
574-
575-
switch (id) {
572+
switch (ppmu_events[i].id) {
576573
case PPMU_PMNCNT0:
577574
case PPMU_PMNCNT1:
578575
case PPMU_PMNCNT2:

0 commit comments

Comments
 (0)