Changes in uspace/drv/block/usbmast/main.c [e0a5d4c:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/usbmast/main.c
re0a5d4c rb7fd2a0 2 2 * Copyright (c) 2011 Vojtech Horky 3 3 * Copyright (c) 2011 Jiri Svoboda 4 * Copyright (c) 2018 Ondrej Hlavaty5 4 * All rights reserved. 6 5 * … … 157 156 usb_device_get_mapped_ep_desc(dev, &bulk_out_ep); 158 157 if (!epm_in || !epm_out || !epm_in->present || !epm_out->present) { 159 usb_log_error("Required EPs were not mapped. ");158 usb_log_error("Required EPs were not mapped.\n"); 160 159 return ENOENT; 161 160 } … … 164 163 mdev = usb_device_data_alloc(dev, sizeof(usbmast_dev_t)); 165 164 if (mdev == NULL) { 166 usb_log_error("Failed allocating softstate. ");165 usb_log_error("Failed allocating softstate.\n"); 167 166 return ENOMEM; 168 167 } … … 170 169 mdev->usb_dev = dev; 171 170 172 usb_log_info("Initializing mass storage `%s'. ",171 usb_log_info("Initializing mass storage `%s'.\n", 173 172 usb_device_get_name(dev)); 174 usb_log_debug("Bulk in endpoint: %d [%zuB]. ",175 epm_in->pipe. desc.endpoint_no, epm_in->pipe.desc.max_transfer_size);176 usb_log_debug("Bulk out endpoint: %d [%zuB]. ",177 epm_out->pipe. desc.endpoint_no, epm_out->pipe.desc.max_transfer_size);178 179 usb_log_debug("Get LUN count... ");173 usb_log_debug("Bulk in endpoint: %d [%zuB].\n", 174 epm_in->pipe.endpoint_no, epm_in->pipe.max_packet_size); 175 usb_log_debug("Bulk out endpoint: %d [%zuB].\n", 176 epm_out->pipe.endpoint_no, epm_out->pipe.max_packet_size); 177 178 usb_log_debug("Get LUN count...\n"); 180 179 mdev->lun_count = usb_masstor_get_lun_count(mdev); 181 180 mdev->luns = calloc(mdev->lun_count, sizeof(ddf_fun_t*)); 182 181 if (mdev->luns == NULL) { 183 usb_log_error("Failed allocating luns table."); 184 return ENOMEM; 182 rc = ENOMEM; 183 usb_log_error("Failed allocating luns table.\n"); 184 goto error; 185 185 } 186 186 … … 226 226 227 227 if (asprintf(&fun_name, "l%u", lun) < 0) { 228 usb_log_error("Out of memory. ");228 usb_log_error("Out of memory.\n"); 229 229 rc = ENOMEM; 230 230 goto error; … … 233 233 fun = usb_device_ddf_fun_create(mdev->usb_dev, fun_exposed, fun_name); 234 234 if (fun == NULL) { 235 usb_log_error("Failed to create DDF function %s. ", fun_name);235 usb_log_error("Failed to create DDF function %s.\n", fun_name); 236 236 rc = ENOMEM; 237 237 goto error; … … 241 241 mfun = ddf_fun_data_alloc(fun, sizeof(usbmast_fun_t)); 242 242 if (mfun == NULL) { 243 usb_log_error("Failed allocating softstate. ");243 usb_log_error("Failed allocating softstate.\n"); 244 244 rc = ENOMEM; 245 245 goto error; … … 257 257 ddf_fun_set_conn_handler(fun, usbmast_bd_connection); 258 258 259 usb_log_debug("Inquire... ");259 usb_log_debug("Inquire...\n"); 260 260 usbmast_inquiry_data_t inquiry; 261 261 rc = usbmast_inquiry(mfun, &inquiry); 262 262 if (rc != EOK) { 263 usb_log_warning("Failed to inquire device `%s': %s. ",263 usb_log_warning("Failed to inquire device `%s': %s.\n", 264 264 usb_device_get_name(mdev->usb_dev), str_error(rc)); 265 265 rc = EIO; … … 281 281 rc = usbmast_read_capacity(mfun, &nblocks, &block_size); 282 282 if (rc != EOK) { 283 usb_log_warning("Failed to read capacity, device `%s': %s. ",283 usb_log_warning("Failed to read capacity, device `%s': %s.\n", 284 284 usb_device_get_name(mdev->usb_dev), str_error(rc)); 285 285 rc = EIO; … … 295 295 rc = ddf_fun_bind(fun); 296 296 if (rc != EOK) { 297 usb_log_error("Failed to bind DDF function %s: %s. ",297 usb_log_error("Failed to bind DDF function %s: %s.\n", 298 298 fun_name, str_error(rc)); 299 299 goto error; … … 390 390 static const usb_driver_ops_t usbmast_driver_ops = { 391 391 .device_add = usbmast_device_add, 392 .device_rem ove= usbmast_device_remove,392 .device_rem = usbmast_device_remove, 393 393 .device_gone = usbmast_device_gone, 394 394 };
Note:
See TracChangeset
for help on using the changeset viewer.