aboutsummaryrefslogtreecommitdiff
path: root/drivers/base/power/common.c
AgeCommit message (Collapse)AuthorFilesLines
2015-02-03PM: Convert dev_pm_put_subsys_data() into a void functionUlf Hansson1-10/+4
Clients using the dev_pm_put_subsys_data() API isn't interested of a return value. They care only of decreasing a reference to the device's pm_subsys_data. So, let's convert the API to a void function, which anyway seems like reasonable thing to do. Signed-off-by: Ulf Hansson <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2015-02-03PM: Update function header for dev_pm_get_subsys_data()Ulf Hansson1-2/+2
The commit "PM: Make dev_pm_get_subsys_data() always return 0 on success" changed the return value from dev_pm_get_subsys_data(). Let's update the comment in the function header to reflect this change as well. Signed-off-by: Ulf Hansson <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2014-09-22PM / Domains: Add APIs to attach/detach a PM domain for a deviceUlf Hansson1-0/+52
To maintain scalability let's add common methods to attach and detach a PM domain for a device, dev_pm_domain_attach|detach(). Typically dev_pm_domain_attach() shall be invoked from subsystem level code at the probe phase to try to attach a device to its PM domain. The reversed actions may be done a the remove phase and then by invoking dev_pm_domain_detach(). When attachment succeeds, the attach function should assign its corresponding detach function to a new ->detach() callback added in the struct dev_pm_domain. Signed-off-by: Ulf Hansson <[email protected]> Tested-by: Philipp Zabel <[email protected]> Reviewed-by: Kevin Hilman <[email protected]> Reviewed-by: Dmitry Torokhov <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2014-02-14drivers/base: delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Cc: Len Brown <[email protected]> Signed-off-by: Paul Gortmaker <[email protected]> Acked-by: Pavel Machek <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-05-12PM: Avoid calling kfree() under spinlock in dev_pm_put_subsys_data()Shuah Khan1-6/+6
Fix dev_pm_put_subsys_data() so that it doesn't call kfree() under a spinlock and make it return 1 whenever it leaves NULL power.subsys_data (regardless of the reason). Signed-off-by: Shuah Khan <[email protected]> Reviewed-by: Pavel Machek <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2012-08-08PM: Make dev_pm_get_subsys_data() always return 0 on successRafael J. Wysocki1-3/+1
Commits 1d5fcfec22 (PM / Domains: Add device domain data reference counter) and 62d4490294 (PM / Domains: Allow device callbacks to be added at any time) added checks for the return value of dev_pm_get_subsys_data(), but those checks were incorrect, because that function returned 1 on success in some cases. Since all of the existing users of dev_pm_get_subsys_data() don't use the positive value returned by it on success, change its definition so that it always returns 0 when successful. Reported-by: Heiko Stübner <[email protected]> Reported-by: Tushar Behera <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2012-03-11device.h: cleanup users outside of linux/include (C files)Paul Gortmaker1-0/+1
For files that are actively using linux/device.h, make sure that they call it out. This will allow us to clean up some of the implicit uses of linux/device.h within include/* without introducing build regressions. Yes, this was created by "cheating" -- i.e. the headers were cleaned up, and then the fallout was found and fixed, and then the two commits were reordered. This ensures we don't introduce build regressions into the git history. Signed-off-by: Paul Gortmaker <[email protected]>
2011-10-31drivers/base: change module.h -> export.h in power/common.cPaul Gortmaker1-1/+1
This file isn't using full modular functionality, and hence can be "downgraded" to just using export.h Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Paul Gortmaker <[email protected]>
2011-08-25PM: Move clock-related definitions and headers to separate fileRafael J. Wysocki1-2/+1
Since the PM clock management code in drivers/base/power/clock_ops.c is used for both runtime PM and system suspend/hibernation, the definitions of data structures and headers related to it should not be located in include/linux/pm_rumtime.h. Move them to a separate header file. Signed-off-by: Rafael J. Wysocki <[email protected]>
2011-08-25PM: Reference counting of power.subsys_dataRafael J. Wysocki1-0/+87
Since the power.subsys_data device field will be used by multiple filesystems, introduce a reference counting mechanism for it to avoid freeing it prematurely or changing its value at a wrong time. Make the PM clocks management code that currently is the only user of power.subsys_data use the new reference counting. Signed-off-by: Rafael J. Wysocki <[email protected]>