]> git.baikalelectronics.ru Git - kernel.git/commit
PM: Avoid false-positive warnings in dev_pm_domain_set()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 30 Jan 2016 11:54:29 +0000 (12:54 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 3 Feb 2016 18:10:37 +0000 (19:10 +0100)
commit7b266363452ff317189e43fbe5e6a14464e5821c
tree15ccff24ec3b0f789c2c0da116551e6759516c94
parent77fba60b7aa6115f4d9e824c97e9aeaa828a1e35
PM: Avoid false-positive warnings in dev_pm_domain_set()

There is a WARN_ON() in dev_pm_domain_set() that triggers on attempts
to set the pm_domain pointer for devices with a driver bound.

However, that WARN_ON() triggers on attempts to clear the pointer
too and the test it uses is based on checking the device's
p->knode_driver pointer which still is set when the device bus
type's/driver's ->remove callback has been executed.  This
leads to false-positive warnings when bus type code calls
dev_pm_domain_set() to clear the pm_domain pointer after
invoking the driver's ->remove() callback.

To avoid those false-positives, make dev_pm_domain_set() check
if the pointer passed to it is NULL and skip the warning in
that case.

Fixes: 7c5abed06cd7 (PM / Domains: add setter for dev.pm_domain)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Sinan Kaya <okaya@codeaurora.org>
Tested-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/base/power/common.c