public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafa? Bilski" <rafalbilski@interia.pl>
To: linux-kernel@vger.kernel.org
Subject: PCI - Unnecessary high-level?
Date: Fri, 02 Jun 2006 23:25:20 +0200	[thread overview]
Message-ID: <4480ACC0.2020806@interia.pl> (raw)

Why pci_device->suspend() is called with pm_message_t?
IMO this is low-level PCI driver specific function.
All drivers are calling pci_choose_state(). If this function
would be called with pci_power_t maybe would be more PCI aware
code compatible. Maybe code below would be better? 


--- linux-2.6.17-rc5/include/linux/pci.h.orig	2006-05-31 09:00:42.000000000 +0200
+++ linux-2.6.17-rc5/include/linux/pci.h	2006-06-02 22:41:11.000000000 +0200
@@ -342,7 +342,7 @@ struct pci_driver {
 	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, pm_message_t state);	/* Device suspended */
+	int  (*suspend) (struct pci_dev *dev, pci_power_t state);	/* Device suspended */
 	int  (*resume) (struct pci_dev *dev);	                /* Device woken up */
 	int  (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable);   /* Enable wake event */
 	void (*shutdown) (struct pci_dev *dev);


--- linux-2.6.17-rc5/drivers/pci/pci-driver.c.orig	2006-05-31 09:00:31.000000000 +0200
+++ linux-2.6.17-rc5/drivers/pci/pci-driver.c	2006-06-02 22:44:18.000000000 +0200
@@ -272,7 +272,7 @@ static int pci_device_suspend(struct dev
 	int i = 0;
 
 	if (drv && drv->suspend) {
-		i = drv->suspend(pci_dev, state);
+		i = drv->suspend( pci_dev, pci_choose_state(state) );
 		suspend_report_result(drv->suspend, i);
 	} else {
 		pci_save_state(pci_dev);


----------------------------------------------------------------------
Poznaj Stefana! Zmien komunikator! >>> http://link.interia.pl/f1924


             reply	other threads:[~2006-06-02 21:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-02 21:25 Rafa? Bilski [this message]
2006-05-31  1:01 ` PCI - Unnecessary high-level? Pavel Machek

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=4480ACC0.2020806@interia.pl \
    --to=rafalbilski@interia.pl \
    --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