aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_device.c
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2016-01-07 10:46:13 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-01-07 19:12:06 -0500
commit989561de9b5112999475b406557d9c7e9e59c041 (patch)
tree1c4257ef719116fecbea9ecdd14febb6af2c336b /arch/arm/mach-omap2/omap_device.c
parent6b9cb42752dafba3761dde0002ca58ca518b6311 (diff)
PM / Domains: add setter for dev.pm_domain
Adds a function that sets the pointer to dev_pm_domain in struct device and that warns if the device has already finished probing. The reason why we want to enforce that is because in the general case that can cause problems and also that we can simplify code quite a bit if we can always assume that. This patch also changes all current code that directly sets the dev.pm_domain pointer. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_device.c')
-rw-r--r--arch/arm/mach-omap2/omap_device.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index 72ebc4c16bae..220822bcfe3f 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -32,6 +32,7 @@
32#include <linux/io.h> 32#include <linux/io.h>
33#include <linux/clk.h> 33#include <linux/clk.h>
34#include <linux/clkdev.h> 34#include <linux/clkdev.h>
35#include <linux/pm_domain.h>
35#include <linux/pm_runtime.h> 36#include <linux/pm_runtime.h>
36#include <linux/of.h> 37#include <linux/of.h>
37#include <linux/notifier.h> 38#include <linux/notifier.h>
@@ -168,7 +169,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
168 r->name = dev_name(&pdev->dev); 169 r->name = dev_name(&pdev->dev);
169 } 170 }
170 171
171 pdev->dev.pm_domain = &omap_device_pm_domain; 172 dev_pm_domain_set(&pdev->dev, &omap_device_pm_domain);
172 173
173 if (device_active) { 174 if (device_active) {
174 omap_device_enable(pdev); 175 omap_device_enable(pdev);
@@ -180,7 +181,7 @@ odbfd_exit1:
180odbfd_exit: 181odbfd_exit:
181 /* if data/we are at fault.. load up a fail handler */ 182 /* if data/we are at fault.. load up a fail handler */
182 if (ret) 183 if (ret)
183 pdev->dev.pm_domain = &omap_device_fail_pm_domain; 184 dev_pm_domain_set(&pdev->dev, &omap_device_fail_pm_domain);
184 185
185 return ret; 186 return ret;
186} 187}
@@ -701,7 +702,7 @@ int omap_device_register(struct platform_device *pdev)
701{ 702{
702 pr_debug("omap_device: %s: registering\n", pdev->name); 703 pr_debug("omap_device: %s: registering\n", pdev->name);
703 704
704 pdev->dev.pm_domain = &omap_device_pm_domain; 705 dev_pm_domain_set(&pdev->dev, &omap_device_pm_domain);
705 return platform_device_add(pdev); 706 return platform_device_add(pdev);
706} 707}
707 708