Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/usbmast/main.c

    r4172db4a rcde999a  
    156156            usb_device_get_mapped_ep_desc(dev, &bulk_out_ep);
    157157        if (!epm_in || !epm_out || !epm_in->present || !epm_out->present) {
    158                 usb_log_error("Required EPs were not mapped.");
     158                usb_log_error("Required EPs were not mapped.\n");
    159159                return ENOENT;
    160160        }
     
    163163        mdev = usb_device_data_alloc(dev, sizeof(usbmast_dev_t));
    164164        if (mdev == NULL) {
    165                 usb_log_error("Failed allocating softstate.");
     165                usb_log_error("Failed allocating softstate.\n");
    166166                return ENOMEM;
    167167        }
     
    169169        mdev->usb_dev = dev;
    170170
    171         usb_log_info("Initializing mass storage `%s'.",
     171        usb_log_info("Initializing mass storage `%s'.\n",
    172172            usb_device_get_name(dev));
    173         usb_log_debug("Bulk in endpoint: %d [%zuB].",
    174             epm_in->pipe.desc.endpoint_no, epm_in->pipe.desc.max_transfer_size);
    175         usb_log_debug("Bulk out endpoint: %d [%zuB].",
    176             epm_out->pipe.desc.endpoint_no, epm_out->pipe.desc.max_transfer_size);
    177 
    178         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");
    179179        mdev->lun_count = usb_masstor_get_lun_count(mdev);
    180180        mdev->luns = calloc(mdev->lun_count, sizeof(ddf_fun_t*));
    181181        if (mdev->luns == NULL) {
    182                 usb_log_error("Failed allocating luns table.");
    183                 return ENOMEM;
     182                rc = ENOMEM;
     183                usb_log_error("Failed allocating luns table.\n");
     184                goto error;
    184185        }
    185186
     
    215216 * @param mdev          Mass storage device
    216217 * @param lun           LUN
    217  * @return              EOK on success or negative error code.
     218 * @return              EOK on success or an error code.
    218219 */
    219220static int usbmast_fun_create(usbmast_dev_t *mdev, unsigned lun)
     
    225226
    226227        if (asprintf(&fun_name, "l%u", lun) < 0) {
    227                 usb_log_error("Out of memory.");
     228                usb_log_error("Out of memory.\n");
    228229                rc = ENOMEM;
    229230                goto error;
     
    232233        fun = usb_device_ddf_fun_create(mdev->usb_dev, fun_exposed, fun_name);
    233234        if (fun == NULL) {
    234                 usb_log_error("Failed to create DDF function %s.", fun_name);
     235                usb_log_error("Failed to create DDF function %s.\n", fun_name);
    235236                rc = ENOMEM;
    236237                goto error;
     
    240241        mfun = ddf_fun_data_alloc(fun, sizeof(usbmast_fun_t));
    241242        if (mfun == NULL) {
    242                 usb_log_error("Failed allocating softstate.");
     243                usb_log_error("Failed allocating softstate.\n");
    243244                rc = ENOMEM;
    244245                goto error;
     
    256257        ddf_fun_set_conn_handler(fun, usbmast_bd_connection);
    257258
    258         usb_log_debug("Inquire...");
     259        usb_log_debug("Inquire...\n");
    259260        usbmast_inquiry_data_t inquiry;
    260261        rc = usbmast_inquiry(mfun, &inquiry);
    261262        if (rc != EOK) {
    262                 usb_log_warning("Failed to inquire device `%s': %s.",
     263                usb_log_warning("Failed to inquire device `%s': %s.\n",
    263264                    usb_device_get_name(mdev->usb_dev), str_error(rc));
    264265                rc = EIO;
     
    280281        rc = usbmast_read_capacity(mfun, &nblocks, &block_size);
    281282        if (rc != EOK) {
    282                 usb_log_warning("Failed to read capacity, device `%s': %s.",
     283                usb_log_warning("Failed to read capacity, device `%s': %s.\n",
    283284                    usb_device_get_name(mdev->usb_dev), str_error(rc));
    284285                rc = EIO;
     
    294295        rc = ddf_fun_bind(fun);
    295296        if (rc != EOK) {
    296                 usb_log_error("Failed to bind DDF function %s: %s.",
     297                usb_log_error("Failed to bind DDF function %s: %s.\n",
    297298                    fun_name, str_error(rc));
    298299                goto error;
     
    389390static const usb_driver_ops_t usbmast_driver_ops = {
    390391        .device_add = usbmast_device_add,
    391         .device_remove = usbmast_device_remove,
     392        .device_rem = usbmast_device_remove,
    392393        .device_gone = usbmast_device_gone,
    393394};
Note: See TracChangeset for help on using the changeset viewer.