When Patrick removed ide_notify_reboot() in 2.5.42, he didn't notice
that it meant that IDE no longer had any shutdown() functionality.
So we did the right thing on suspend, but not on shutdown.
ide_notify_reboot() was only doing STANDBY on shutdown (because FLUSH
'doesn't work' in 2.4 too) but it worked okay and we still should do STANDBY
on shutdown because some broken disks flush their caches.
Thus just calls bus->suspend() (FLUSH+STANDBY) at shutdown time. We can
add some safety delay later - 2.4 doesn't have any.
static int idedisk_attach(ide_drive_t *drive);
+static void ide_device_shutdown(struct device *dev)
+{
+ ide_drive_t *drive = container_of(dev, ide_drive_t, gendev);
+
+ printk("Shutdown: %s\n", drive->name);
+ dev->bus->suspend(dev, PM_SUSPEND_STANDBY);
+}
+
/*
* IDE subdriver functions, registered with ide.c
*/
static ide_driver_t idedisk_driver = {
.owner = THIS_MODULE,
+ .gen_driver = {
+ .shutdown = ide_device_shutdown,
+ },
.name = "ide-disk",
.version = IDEDISK_VERSION,
.media = ide_disk,