提交 ce9b2b0a 编写于 作者: R Rafael J. Wysocki 提交者: Bartlomiej Zolnierkiewicz

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: NRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 d09c6b80
...@@ -1010,7 +1010,6 @@ static int generic_ide_resume(struct device *dev) ...@@ -1010,7 +1010,6 @@ static int generic_ide_resume(struct device *dev)
{ {
ide_drive_t *drive = dev->driver_data; ide_drive_t *drive = dev->driver_data;
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
ide_driver_t *drv = to_ide_driver(dev->driver);
struct request rq; struct request rq;
struct request_pm_state rqpm; struct request_pm_state rqpm;
ide_task_t args; ide_task_t args;
...@@ -1033,8 +1032,12 @@ static int generic_ide_resume(struct device *dev) ...@@ -1033,8 +1032,12 @@ static int generic_ide_resume(struct device *dev)
err = ide_do_drive_cmd(drive, &rq, ide_head_wait); err = ide_do_drive_cmd(drive, &rq, ide_head_wait);
if (err == 0 && drv && drv->resume) if (err == 0 && dev->driver) {
drv->resume(drive); ide_driver_t *drv = to_ide_driver(dev->driver);
if (drv->resume)
drv->resume(drive);
}
return err; return err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册