mirror of https://gitee.com/openkylin/linux.git
ide: fix generic_ide_suspend/resume Oops
This patch fixes a regresion introduced by commit 0998d063
(device-core: Ensure
drvdata = NULL when no driver is bound).
Suspend oopses in generic_ide_suspend() because dev_get_drvdata()
returns NULL (dev->p->driver_data == NULL) and this function is not
prepared for this.
Fix is based on Alan Stern's suggestion.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1456c75a80
commit
9974e43d90
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
int generic_ide_suspend(struct device *dev, pm_message_t mesg)
|
int generic_ide_suspend(struct device *dev, pm_message_t mesg)
|
||||||
{
|
{
|
||||||
ide_drive_t *drive = dev_get_drvdata(dev);
|
ide_drive_t *drive = to_ide_device(dev);
|
||||||
ide_drive_t *pair = ide_get_pair_dev(drive);
|
ide_drive_t *pair = ide_get_pair_dev(drive);
|
||||||
ide_hwif_t *hwif = drive->hwif;
|
ide_hwif_t *hwif = drive->hwif;
|
||||||
struct request *rq;
|
struct request *rq;
|
||||||
|
@ -40,7 +40,7 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
|
||||||
|
|
||||||
int generic_ide_resume(struct device *dev)
|
int generic_ide_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
ide_drive_t *drive = dev_get_drvdata(dev);
|
ide_drive_t *drive = to_ide_device(dev);
|
||||||
ide_drive_t *pair = ide_get_pair_dev(drive);
|
ide_drive_t *pair = ide_get_pair_dev(drive);
|
||||||
ide_hwif_t *hwif = drive->hwif;
|
ide_hwif_t *hwif = drive->hwif;
|
||||||
struct request *rq;
|
struct request *rq;
|
||||||
|
|
Loading…
Reference in New Issue