diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2016-04-14 01:37:12 -0400 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2016-05-02 22:21:51 -0400 |
commit | 19cf91d0f9ddc494217a0abaed91dfbddea7c958 (patch) | |
tree | 9ec34e787a65122cd9c3cf82aa6d41d687dc5274 /drivers/devfreq/devfreq-event.c | |
parent | 0179a913875a8b39eaf5b848c876439a3a4650af (diff) |
PM / devfreq: event: Find the instance of devfreq-event device by using phandle
This patch use the phandle to find the instance of devfreq-event device in
Device Tree when calling the devfreq_event_get_edev_by_phandle() because there
is two type devfreq-event devices as following:
First case, exynos-ppmu.c driver provides the maximum four event of each PPMU.
So, when getting the instance of devfreq-event device, using the unique name of
struct devfreq_event_desc.
Second case, exynos-nocp.c driver provide the only one event of each NoC Probe
device. So, when getting the instance of devfreq-event device, using the
phandle of each NoC probe device.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/devfreq/devfreq-event.c')
-rw-r--r-- | drivers/devfreq/devfreq-event.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c index 38bf144ca147..39b048eda2ce 100644 --- a/drivers/devfreq/devfreq-event.c +++ b/drivers/devfreq/devfreq-event.c | |||
@@ -235,6 +235,11 @@ struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev, | |||
235 | 235 | ||
236 | mutex_lock(&devfreq_event_list_lock); | 236 | mutex_lock(&devfreq_event_list_lock); |
237 | list_for_each_entry(edev, &devfreq_event_list, node) { | 237 | list_for_each_entry(edev, &devfreq_event_list, node) { |
238 | if (edev->dev.parent && edev->dev.parent->of_node == node) | ||
239 | goto out; | ||
240 | } | ||
241 | |||
242 | list_for_each_entry(edev, &devfreq_event_list, node) { | ||
238 | if (!strcmp(edev->desc->name, node->name)) | 243 | if (!strcmp(edev->desc->name, node->name)) |
239 | goto out; | 244 | goto out; |
240 | } | 245 | } |