Changeset 743f2cdd in mainline for uspace/lib/ata/src/ata.c
- Timestamp:
- 2024-06-20T07:24:07Z (4 months ago)
- Branches:
- master
- Children:
- ec50d65e
- Parents:
- 7cec216
- git-author:
- Jiri Svoboda <jiri@…> (2024-06-19 17:23:44)
- git-committer:
- Jiri Svoboda <jiri@…> (2024-06-20 07:24:07)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ata/src/ata.c
r7cec216 r743f2cdd 179 179 int n_disks; 180 180 bool irq_inited = false; 181 bool dev_added[MAX_DEVICES]; 182 183 for (i = 0; i < MAX_DEVICES; i++) 184 dev_added[i] = false; 181 185 182 186 ata_msg_debug(chan, "ata_channel_initialize()"); … … 212 216 goto error; 213 217 } 218 dev_added[i] = true; 214 219 ++n_disks; 215 220 } … … 224 229 error: 225 230 for (i = 0; i < MAX_DEVICES; i++) { 226 if (ata_device_add(&chan->device[i]) != EOK) { 227 ata_msg_error(chan, "Unable to remove device %d.", i); 231 if (dev_added[i]) { 232 rc = ata_device_remove(&chan->device[i]); 233 if (rc != EOK) { 234 ata_msg_error(chan, 235 "Unable to remove device %d.", i); 236 } 228 237 } 229 238 }
Note:
See TracChangeset
for help on using the changeset viewer.