summaryrefslogtreecommitdiff
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-06-16 02:24:43 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-06-16 02:24:43 +0200
commitce9b2b0abbf019d5259eb089a1cc256852930f67 (patch)
treec60d73f008d1c70002bef6b35901e4105269bc12 /drivers/ide/ide.c
parentd09c6b809432668371b5de9102f4f9aa6a7c79cc (diff)
Resume from RAM on HPC nx6325 broken
generic_ide_resume() should check if dev->driver is not NULL before applying to_ide_driver() to it. Fix that. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r--drivers/ide/ide.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 0af0d1614f75..0cd76bf66833 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1010,7 +1010,6 @@ static int generic_ide_resume(struct device *dev)
{
ide_drive_t *drive = dev->driver_data;
ide_hwif_t *hwif = HWIF(drive);
- ide_driver_t *drv = to_ide_driver(dev->driver);
struct request rq;
struct request_pm_state rqpm;
ide_task_t args;
@@ -1033,8 +1032,12 @@ static int generic_ide_resume(struct device *dev)
err = ide_do_drive_cmd(drive, &rq, ide_head_wait);
- if (err == 0 && drv && drv->resume)
- drv->resume(drive);
+ if (err == 0 && dev->driver) {
+ ide_driver_t *drv = to_ide_driver(dev->driver);
+
+ if (drv->resume)
+ drv->resume(drive);
+ }
return err;
}