@@ -1270,10 +1270,17 @@ static int exynos5_dmc_init_clks(struct exynos5_dmc *dmc)
static struct devfreq_event_dev *exynos5_dmc_get_edev(struct device_node *np,
int index)
{
- struct device_node *node = of_parse_phandle(np, "devfreq-events",
+ struct device_node *node = of_parse_phandle(np, "exynos,ppmu-device",
index);
- if (!node)
- return ERR_PTR(-ENODEV);
+ if (!node) {
+ /*
+ * Check the deprecated 'devfreq-events' property
+ * to support backward-compatibility.
+ */
+ node = of_parse_phandle(np, "devfreq-events", index);
+ if (!node)
+ return ERR_PTR(-ENODEV);
+ }
return devfreq_event_get_edev_by_node(node);
}
@@ -1292,10 +1299,20 @@ static int exynos5_performance_counters_init(struct exynos5_dmc *dmc)
int ret, i;
dmc->num_counters = of_property_count_elems_of_size(dmc->dev->of_node,
- "devfreq-events", sizeof(u32));
+ "exynos,ppmu-device", sizeof(u32));
if (dmc->num_counters < 0) {
- dev_err(dmc->dev, "could not get devfreq-event counters\n");
- return dmc->num_counters;
+ /*
+ * Check the deprecated 'devfreq-events' property
+ * to support backward-compatibility.
+ */
+ dmc->num_counters = of_property_count_elems_of_size(
+ dmc->dev->of_node,
+ "devfreq-events", sizeof(u32));
+ if (dmc->num_counters < 0) {
+ dev_err(dmc->dev,
+ "could not get devfreq-event counters\n");
+ return dmc->num_counters;
+ }
}
counters_size = sizeof(struct devfreq_event_dev) * dmc->num_counters;