ide: fix generic_ide_suspend/resume Oops
authorMiklos Szeredi <mszeredi@suse.cz>
Tue, 21 Aug 2012 15:20:30 +0000 (17:20 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Aug 2012 21:54:42 +0000 (14:54 -0700)
commit9974e43d900af7979e0a571b8e0c9674c7399b79
treef01213908106e0508ef97c8c2b9b8aa08f70c4e6
parent1456c75a80dfd3fd02b9ea44d1223bb51a5683d5
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>
drivers/ide/ide-pm.c