From: Pavel Machek <pavel@ucw.cz>
To: Andrew Morton <akpm@zip.com.au>,
kernel list <linux-kernel@vger.kernel.org>
Subject: driver model: pass pm_message_t down to pci drivers
Date: Mon, 17 Jan 2005 21:16:25 +0100 [thread overview]
Message-ID: <20050117201625.GA1779@elf.ucw.cz> (raw)
Hi!
This passes pm_message_t down to PCI drivers. Ugly translation code
can be removed and this will allow PCI devices to do right thing
during swsusp snapshot -- like not unneccessarily blanking display.
Only obscure /sysfs code passes anything but 3 to to
pci_device_suspend, anyway, so this is pretty close to nop ;-).
Please apply,
Pavel
Signed-off-by: Pavel Machek <pavel@suse.cz>
--- clean-cvs/drivers/pci/pci-driver.c 2005-01-16 22:27:25.000000000 +0100
+++ linux-cvs/drivers/pci/pci-driver.c 2005-01-17 00:19:56.000000000 +0100
@@ -288,23 +288,10 @@
{
struct pci_dev * pci_dev = to_pci_dev(dev);
struct pci_driver * drv = pci_dev->driver;
- u32 dev_state;
int i = 0;
- /* Translate PM_SUSPEND_xx states to PCI device states */
- static u32 state_conversion[] = {
- [PM_SUSPEND_ON] = 0,
- [PM_SUSPEND_STANDBY] = 1,
- [PM_SUSPEND_MEM] = 3,
- [PM_SUSPEND_DISK] = 3,
- };
-
- if (state >= sizeof(state_conversion) / sizeof(state_conversion[1]))
- return -EINVAL;
-
- dev_state = state_conversion[state];
if (drv && drv->suspend)
- i = drv->suspend(pci_dev, dev_state);
+ i = drv->suspend(pci_dev, state);
else
pci_save_state(pci_dev);
return i;
--- clean-cvs/include/linux/pci.h 2005-01-16 22:29:13.000000000 +0100
+++ linux-cvs/include/linux/pci.h 2005-01-16 23:58:54.000000000 +0100
@@ -667,7 +667,7 @@
const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */
int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
- int (*suspend) (struct pci_dev *dev, u32 state); /* Device suspended */
+ int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */
int (*resume) (struct pci_dev *dev); /* Device woken up */
int (*enable_wake) (struct pci_dev *dev, u32 state, int enable); /* Enable wake event */
@@ -823,7 +823,7 @@
int pci_save_state(struct pci_dev *dev);
int pci_restore_state(struct pci_dev *dev);
int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
-pci_power_t pci_choose_state(struct pci_dev *dev, u32 state);
+pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable);
/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
reply other threads:[~2005-01-17 20:16 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=20050117201625.GA1779@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=akpm@zip.com.au \
--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