UPSTREAM: PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev
authorChanwoo Choi <cw00.choi@samsung.com>
Tue, 8 Nov 2016 09:13:27 +0000 (18:13 +0900)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 29 Mar 2017 02:41:33 +0000 (10:41 +0800)
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

index 3dc3b99fc61f84ff0d74cfb0e6c2d3dc396be56f..fe75121c8209e1d6814cef64a996a8f4474eb056 100644 (file)
@@ -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))