summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-07-27 14:53:28 +0900
committerJeff Garzik <jeff@garzik.org>2007-08-01 10:00:56 -0400
commit8c3832ebeb049c5744ece888daae253c683257c3 (patch)
treef03eaab444be5d8e4d8c3bc229fc052ee4b791b9 /drivers/ata
parent0b62e13b5c9b4871641973e024cc9dd440b5bb58 (diff)
ata_piix: implement piix_borken_suspend()
Separate out broken suspend blacklist matching into piix_broken_suspend(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/ata_piix.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 6089fbc5b89f..fb3b9594651d 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -890,37 +890,38 @@ static void ich_set_dmamode (struct ata_port *ap, struct ata_device *adev)
}
#ifdef CONFIG_PM
-static struct dmi_system_id piix_broken_suspend_dmi_table[] = {
- {
- .ident = "TECRA M5",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
- DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"),
+static int piix_broken_suspend(void)
+{
+ static struct dmi_system_id sysids[] = {
+ {
+ .ident = "TECRA M5",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"),
+ },
},
- },
- {
- .ident = "Satellite U200",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"),
+ {
+ .ident = "Satellite U205",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U205"),
+ },
},
- },
- {
- .ident = "Satellite U205",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U205"),
+ {
+ .ident = "Portege M500",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M500"),
+ },
},
- },
- {
- .ident = "Portege M500",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M500"),
- },
- },
- { }
-};
+ { }
+ };
+
+ if (dmi_check_system(sysids))
+ return 1;
+
+ return 0;
+}
static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
{
@@ -937,8 +938,7 @@ static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
* cycles and power trying to do something to the sleeping
* beauty.
*/
- if (dmi_check_system(piix_broken_suspend_dmi_table) &&
- mesg.event == PM_EVENT_SUSPEND) {
+ if (piix_broken_suspend() && mesg.event == PM_EVENT_SUSPEND) {
pci_save_state(pdev);
/* mark its power state as "unknown", since we don't