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