From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI fixes for 2.6.0-test6
Date: Tue, 30 Sep 2003 15:35:50 -0700 [thread overview]
Message-ID: <10649613503148@kroah.com> (raw)
In-Reply-To: <1064961349577@kroah.com>
ChangeSet 1.1346, 2003/09/26 16:34:55-07:00, mochel@osdl.org
[PATCH] Remove ->save_state() in sc1200.c
This removes the uncalled and unneeded method struct
pci_driver::save_state(). The contents of ->save_state() were folded into
->suspend(), though the semantics don't seem exactly right - the hwifs
should not be iterated over there; the driver core should take care of
that. But, that code will never get executed as is, since neither function
should ever be called with (state == 0).
drivers/ide/pci/sc1200.c | 61 +++++++++++++++++++++++------------------------
1 files changed, 30 insertions(+), 31 deletions(-)
diff -Nru a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
--- a/drivers/ide/pci/sc1200.c Tue Sep 30 15:20:43 2003
+++ b/drivers/ide/pci/sc1200.c Tue Sep 30 15:20:43 2003
@@ -396,44 +396,44 @@
__u32 regs[4];
} sc1200_saved_state_t;
-static int sc1200_save_state (struct pci_dev *dev, u32 state)
+
+static int sc1200_suspend (struct pci_dev *dev, u32 state)
{
ide_hwif_t *hwif = NULL;
-printk("SC1200: save_state(%u)\n", state);
- if (state != 0)
- return 0; // we only save state when going from full power to less
- //
- // Loop over all interfaces that are part of this PCI device:
- //
- while ((hwif = lookup_pci_dev(hwif, dev)) != NULL) {
- sc1200_saved_state_t *ss;
- unsigned int basereg, r;
- //
- // allocate a permanent save area, if not already allocated
- //
- ss = (sc1200_saved_state_t *)hwif->config_data;
- if (ss == NULL) {
- ss = kmalloc(sizeof(sc1200_saved_state_t), GFP_KERNEL);
- if (ss == NULL)
- return -ENOMEM;
- (sc1200_saved_state_t *)hwif->config_data = ss;
- }
- ss = (sc1200_saved_state_t *)hwif->config_data;
+ printk("SC1200: suspend(%u)\n", state);
+
+ if (state == 0) {
+ // we only save state when going from full power to less
+
//
- // Save timing registers: this may be unnecessary if BIOS also does it
+ // Loop over all interfaces that are part of this PCI device:
//
- basereg = hwif->channel ? 0x50 : 0x40;
- for (r = 0; r < 4; ++r) {
- pci_read_config_dword (hwif->pci_dev, basereg + (r<<2), &ss->regs[r]);
+ while ((hwif = lookup_pci_dev(hwif, dev)) != NULL) {
+ sc1200_saved_state_t *ss;
+ unsigned int basereg, r;
+ //
+ // allocate a permanent save area, if not already allocated
+ //
+ ss = (sc1200_saved_state_t *)hwif->config_data;
+ if (ss == NULL) {
+ ss = kmalloc(sizeof(sc1200_saved_state_t), GFP_KERNEL);
+ if (ss == NULL)
+ return -ENOMEM;
+ (sc1200_saved_state_t *)hwif->config_data = ss;
+ }
+ ss = (sc1200_saved_state_t *)hwif->config_data;
+ //
+ // Save timing registers: this may be unnecessary if
+ // BIOS also does it
+ //
+ basereg = hwif->channel ? 0x50 : 0x40;
+ for (r = 0; r < 4; ++r) {
+ pci_read_config_dword (hwif->pci_dev, basereg + (r<<2), &ss->regs[r]);
+ }
}
}
- return 0;
-}
-static int sc1200_suspend (struct pci_dev *dev, u32 state)
-{
- printk("SC1200: suspend(%u)\n", state);
/* You don't need to iterate over disks -- sysfs should have done that for you already */
pci_disable_device(dev);
@@ -572,7 +572,6 @@
.name = "SC1200 IDE",
.id_table = sc1200_pci_tbl,
.probe = sc1200_init_one,
- .save_state = sc1200_save_state,
.suspend = sc1200_suspend,
.resume = sc1200_resume,
};
next prev parent reply other threads:[~2003-09-30 22:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-30 22:34 [BK PATCH] PCI fixes for 2.6.0-test6 Greg KH
2003-09-30 22:35 ` [PATCH] " Greg KH
2003-09-30 22:35 ` Greg KH
2003-09-30 22:35 ` Greg KH
2003-09-30 22:35 ` Greg KH
2003-09-30 22:35 ` Greg KH
2003-09-30 22:35 ` Greg KH [this message]
2003-09-30 22:35 ` Greg KH
2003-09-30 22:35 ` Greg KH
2003-09-30 22:35 ` Greg KH
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=10649613503148@kroah.com \
--to=greg@kroah.com \
--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