Changes in uspace/lib/ata/src/ata.c [0dab4850:743f2cdd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ata/src/ata.c
r0dab4850 r743f2cdd 1 1 /* 2 * Copyright (c) 202 5Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 151 151 { 152 152 ata_channel_t *chan; 153 int i;154 153 155 154 chan = calloc(1, sizeof(ata_channel_t)); … … 163 162 fibril_mutex_initialize(&chan->irq_lock); 164 163 fibril_condvar_initialize(&chan->irq_cv); 165 166 for (i = 0; i < MAX_DEVICES; i++)167 chan->device[i].chan = chan;168 164 169 165 *rchan = chan; … … 257 253 258 254 for (i = 0; i < MAX_DEVICES; i++) { 259 if (chan->device[i].present == false)260 continue;261 262 255 rc = ata_device_remove(&chan->device[i]); 263 256 if (rc != EOK) { 264 257 ata_msg_error(chan, "Unable to remove device %d.", i); 265 fibril_mutex_unlock(&chan->lock);266 258 return rc; 267 259 } … … 270 262 ata_bd_fini_irq(chan); 271 263 fibril_mutex_unlock(&chan->lock); 272 free(chan); 273 274 return rc; 264 265 return EOK; 275 266 } 276 267 … … 502 493 unsigned i; 503 494 495 d->chan = chan; 504 496 d->device_id = device_id; 505 497 d->present = false; … … 1537 1529 * exceed DMA buffer size. 1538 1530 */ 1539 if (d->chan->params.use_dma) { 1540 dma_maxnb = d->chan->params.max_dma_xfer / d->block_size; 1541 if (dma_maxnb < maxnb) 1542 maxnb = dma_maxnb; 1543 } 1531 dma_maxnb = d->chan->params.max_dma_xfer / d->block_size; 1532 if (dma_maxnb < maxnb) 1533 maxnb = dma_maxnb; 1544 1534 1545 1535 return maxnb;
Note:
See TracChangeset
for help on using the changeset viewer.