Skip to content

Commit

Permalink
Resume from RAM on HPC nx6325 broken
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rafael J. Wysocki authored and Bartlomiej Zolnierkiewicz committed Jun 16, 2007
1 parent d09c6b8 commit ce9b2b0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit ce9b2b0

Please sign in to comment.