From 07e5bac8255bb990b8a3b772bcfcb1ea1c63769f Mon Sep 17 00:00:00 2001
From: Chanwoo Choi <cw00.choi@samsung.com>
Date: Tue, 8 Nov 2016 18:13:27 +0900
Subject: [PATCH] UPSTREAM: PM / devfreq: rk3399_dmc: Use the resource-managed
 function to add devfreq dev

This patch uses the resource-managed to add the devfreq device.
This function will make it easy to handle the devfreq device.

- struct devfreq *devm_devfreq_add_device(struct device *dev,
				  struct devfreq_dev_profile *profile,
				  const char *governor_name,
				  void *data);

Conflicts:
        drivers/devfreq/rk3399_dmc.c

Change-Id: I2ba2779a1b944931dc240f0593824f0316d11985
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
(cherry picked from commit 927b75a628b1d80fef171420fbd694fc28d9b8e9)
---
 drivers/devfreq/rk3399_dmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
index 3dc3b99fc61f..fe75121c8209 100644
--- a/drivers/devfreq/rk3399_dmc.c
+++ b/drivers/devfreq/rk3399_dmc.c
@@ -461,7 +461,7 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
 	data->volt = regulator_get_voltage(data->vdd_center);
 
 	devp->initial_freq = data->rate;
-	data->devfreq = devfreq_add_device(dev, devp,
+	data->devfreq = devm_devfreq_add_device(dev, devp,
 					   "simple_ondemand",
 					   &data->ondemand_data);
 	if (IS_ERR(data->devfreq))
-- 
2.34.1