[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191220002430.11995-10-cw00.choi@samsung.com>
Date: Fri, 20 Dec 2019 09:24:28 +0900
From: Chanwoo Choi <cw00.choi@...sung.com>
To: robh+dt@...nel.org, krzk@...nel.org, heiko@...ech.de,
leonard.crestez@....com, lukasz.luba@....com
Cc: mark.rutland@....com, a.swigon@...sung.com,
m.szyprowski@...sung.com, kgene@...nel.org, cw00.choi@...sung.com,
myungjoo.ham@...sung.com, kyungmin.park@...sung.com,
linux-pm@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-rockchip@...ts.infradead.org
Subject: [PATCH v2 09/11] memory: samsung: exynos5422-dmc: Replace the
deprecated 'devfreq-events' property
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@....com>
Signed-off-by: Chanwoo Choi <cw00.choi@...sung.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
Powered by blists - more mailing lists