1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-26 16:18:31 +00:00

Dont fumble the ivars on reinit, avoids panic on suspend/resume om some systems that looses thier devices.

Patch by: jhb@
This commit is contained in:
Søren Schmidt 2007-11-19 21:11:26 +00:00
parent 790c2471b9
commit 2d9f60ca25
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173756
3 changed files with 0 additions and 9 deletions

View File

@ -157,12 +157,9 @@ acd_reinit(device_t dev)
{
struct ata_channel *ch = device_get_softc(device_get_parent(dev));
struct ata_device *atadev = device_get_softc(dev);
struct acd_softc *cdp = device_get_ivars(dev);
if (((atadev->unit == ATA_MASTER) && !(ch->devices & ATA_ATAPI_MASTER)) ||
((atadev->unit == ATA_SLAVE) && !(ch->devices & ATA_ATAPI_SLAVE))) {
device_set_ivars(dev, NULL);
free(cdp, M_ACD);
return 1;
}
ATA_SETMODE(device_get_parent(dev), dev);

View File

@ -149,12 +149,9 @@ afd_reinit(device_t dev)
{
struct ata_channel *ch = device_get_softc(device_get_parent(dev));
struct ata_device *atadev = device_get_softc(dev);
struct afd_softc *fdp = device_get_ivars(dev);
if (((atadev->unit == ATA_MASTER) && !(ch->devices & ATA_ATAPI_MASTER)) ||
((atadev->unit == ATA_SLAVE) && !(ch->devices & ATA_ATAPI_SLAVE))) {
device_set_ivars(dev, NULL);
free(fdp, M_AFD);
return 1;
}
ATA_SETMODE(device_get_parent(dev), dev);

View File

@ -195,12 +195,9 @@ ast_reinit(device_t dev)
{
struct ata_channel *ch = device_get_softc(device_get_parent(dev));
struct ata_device *atadev = device_get_softc(dev);
struct ast_softc *stp = device_get_ivars(dev);
if (((atadev->unit == ATA_MASTER) && !(ch->devices & ATA_ATAPI_MASTER)) ||
((atadev->unit == ATA_SLAVE) && !(ch->devices & ATA_ATAPI_SLAVE))) {
device_set_ivars(dev, NULL);
free(stp, M_AST);
return 1;
}
ATA_SETMODE(device_get_parent(dev), dev);