lkml.org 
[lkml]   [2019]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 09/11] memory: samsung: exynos5422-dmc: Replace the deprecated 'devfreq-events' property
Date
Replace the deprecated 'devfreq-events' property with 'exynos,ppmu-device'
property. But, to guarantee the backward-compatibility, keep the support
of 'devfreq-events' property.

Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
drivers/memory/samsung/exynos5422-dmc.c | 29 ++++++++++++++++++++-----
1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
index f11fe29a69fc..6e8aa19e84d3 100644
--- a/drivers/memory/samsung/exynos5422-dmc.c
+++ b/drivers/memory/samsung/exynos5422-dmc.c
@@ -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;
--
2.17.1
\
 
 \ /
  Last update: 2019-12-20 01:19    [W:0.144 / U:1.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site