Initialize variables before resource_int_value().

Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
This commit is contained in:
Alexander Motin 2014-09-12 08:37:21 +00:00
parent 8d5605988e
commit 6e88c2c572

View File

@ -159,6 +159,7 @@ ahci_attach(device_t dev)
device_t child;
ctlr->dev = dev;
ctlr->ccc = 0;
resource_int_value(device_get_name(dev),
device_get_unit(dev), "ccc", &ctlr->ccc);
@ -624,6 +625,7 @@ ahci_ch_attach(device_t dev)
ch->subdeviceid = ctlr->subdeviceid;
ch->numslots = ((ch->caps & AHCI_CAP_NCS) >> AHCI_CAP_NCS_SHIFT) + 1;
mtx_init(&ch->mtx, "AHCI channel lock", NULL, MTX_DEF);
ch->pm_level = 0;
resource_int_value(device_get_name(dev),
device_get_unit(dev), "pm_level", &ch->pm_level);
STAILQ_INIT(&ch->doneq);