Skip to contentSkip to conversation

IDE: fix Power Management

PATCH In review Benjamin Herrenschmidt 1 participant 2 messages Sep 3, 2003 – Sep 4, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IDE: fix Power Management

This is the "final" one hopefully, Bart, check out it's correct, Andrew that I did no typo this time ;)

Spacing is a bit fucked up in setup_driver_defaults due to the field name beeing too long (gah !) but that isn't too bad...

Ben.

drivers/ide/ide.c +7 -0
diff -urN for-linus-ppc/drivers/ide/ide.c linuxppc-2.5-benh/drivers/ide/ide.c
@@ -2406,6 +2406,12 @@
 	return ide_abort(drive, msg);
 }
 
+static int default_start_power_step(ide_drive_t *drive, struct request *rq)
+{
+	rq->pm->pm_step = ide_pm_state_completed;
+	return ide_stopped;
+}
+
 static void setup_driver_defaults (ide_driver_t *d)
 {
 	if (d->cleanup == NULL)		d->cleanup = default_cleanup;
@@ -2420,6 +2426,7 @@
 	if (d->capacity == NULL)	d->capacity = default_capacity;
 	if (d->special == NULL)		d->special = default_special;
 	if (d->attach == NULL)		d->attach = default_attach;
+	if (d->start_power_step == NULL)d->start_power_step = default_start_power_step;
 }
 
 int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int version)
#1 lore raw
Quoted 5 lines · Benjamin Herrenschmidt

This is the "final" one hopefully, Bart, check out it's correct, Andrew that I did no typo this time ;)

Spacing is a bit fucked up in setup_driver_defaults due to the field name beeing too long (gah !) but that isn't too bad...

And it's even better with the proper return type... go figure why I didn't see the gcc warning yesterday...

===== drivers/ide/ide.c 1.94 vs edited =====

drivers/ide/ide.c +7 -0
@@ -2406,6 +2406,12 @@
 	return ide_abort(drive, msg);
 }
 
+static ide_startstop_t default_start_power_step(ide_drive_t *drive, struct request *rq)
+{
+	rq->pm->pm_step = ide_pm_state_completed;
+	return ide_stopped;
+}
+
 static void setup_driver_defaults (ide_driver_t *d)
 {
 	if (d->cleanup == NULL)		d->cleanup = default_cleanup;
@@ -2420,6 +2426,7 @@
 	if (d->capacity == NULL)	d->capacity = default_capacity;
 	if (d->special == NULL)		d->special = default_special;
 	if (d->attach == NULL)		d->attach = default_attach;
+	if (d->start_power_step == NULL)d->start_power_step = default_start_power_step;
 }
 
 int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int version)