PM: Improve error code of pm_notifier_call_chain()
[pandora-kernel.git] / kernel / power / main.c
index 2981af4..6c601f8 100644 (file)
@@ -37,8 +37,9 @@ EXPORT_SYMBOL_GPL(unregister_pm_notifier);
 
 int pm_notifier_call_chain(unsigned long val)
 {
-       return (blocking_notifier_call_chain(&pm_chain_head, val, NULL)
-                       == NOTIFY_BAD) ? -EINVAL : 0;
+       int ret = blocking_notifier_call_chain(&pm_chain_head, val, NULL);
+
+       return notifier_to_errno(ret);
 }
 
 /* If set, devices may be suspended and resumed asynchronously. */