linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blade <eblade@blackmagik.dynup.net>
To: linux-kernel@vger.kernel.org
Subject: Patch: linux-2.5.42/drivers/base/power.c - add state for SHUT_DOWN
Date: 14 Oct 2002 01:53:17 -0400	[thread overview]
Message-ID: <1034574797.2683.60.camel@cpq> (raw)

OK, I tested this against a fresh kernel tree, not once but 4 times. 
I'm not sure why people have had problems applying this.

This also fixes some slight spacing issues  -  if(x)  vs if (x) ...

This doesn't fix the problem with IDE spinning down on reboot, but it
does fix what could potentially be problems with very low power suspend
levels in the ACPI code.

--- a/include/linux/device.h    Sat Oct 12 00:22:19 2002
+++ linux/include/linux/device.h        Mon Oct 14 01:48:47 2002
@@ -40,6 +40,7 @@
        SUSPEND_SAVE_STATE,
        SUSPEND_DISABLE,
        SUSPEND_POWER_DOWN,
+       SUSPEND_SHUT_DOWN,
 };

 enum {
--- a/drivers/base/power.c      Sat Oct 12 00:22:11 2002
+++ linux/drivers/base/power.c  Mon Oct 14 01:49:22 2002
@@ -31,7 +31,7 @@
        struct device * prev = NULL;
        int error = 0;

-       if(level == SUSPEND_POWER_DOWN)
+       if (level == SUSPEND_SHUT_DOWN)
                printk(KERN_EMERG "Shutting down devices\n");
        else
                printk(KERN_EMERG "Suspending devices\n");
@@ -41,11 +41,11 @@
                struct device * dev = get_device_locked(to_dev(node));
                if (dev) {
                        spin_unlock(&device_lock);
-                       if(dev->driver) {
-                               if(level == SUSPEND_POWER_DOWN) {
-                                       if(dev->driver->remove)
+                       if (dev->driver) {
+                               if (level == SUSPEND_SHUT_DOWN) {
+                                       if (dev->driver->remove)
                                               
dev->driver->remove(dev);
-                               } else if(dev->driver->suspend) 
+                               } else if (dev->driver->suspend) 
                                        error =
dev->driver->suspend(dev,state,level);
                        }
                        if (prev)
@@ -96,7 +96,7 @@
  */
 void device_shutdown(void)
 {
-       device_suspend(4, SUSPEND_POWER_DOWN);
+       device_suspend(4, SUSPEND_SHUT_DOWN);
 }

 EXPORT_SYMBOL(device_suspend);




                 reply	other threads:[~2002-10-14  5:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1034574797.2683.60.camel@cpq \
    --to=eblade@blackmagik.dynup.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).