Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d86a407c authored by Dov Levenglick's avatar Dov Levenglick
Browse files

usb: gadget: add newlines to all debug prints



Adding '\n' to all debug prints in the data functions
in order to make the dmesg output clearer to follow.

Change-Id: I42840da1d5b8d169d72770b8ea6cfd7f9da29973
Signed-off-by: default avatarDov Levenglick <dovl@codeaurora.org>
parent 1bd946f4
Loading
Loading
Loading
Loading
+60 −59
Original line number Diff line number Diff line
@@ -690,7 +690,7 @@ static void fmbim_ctrl_response_available(struct f_mbim *dev)
	}

	if (atomic_inc_return(&dev->not_port.notify_count) != 1) {
		pr_debug("delay ep_queue: notifications queue is busy[%d]",
		pr_debug("delay ep_queue: notifications queue is busy[%d]\n",
			atomic_read(&dev->not_port.notify_count));
		spin_unlock_irqrestore(&dev->lock, flags);
		return;
@@ -713,7 +713,7 @@ static void fmbim_ctrl_response_available(struct f_mbim *dev)
		pr_err("ep enqueue error %d\n", ret);
	}

	pr_debug("Successful Exit");
	pr_debug("Successful Exit\n");
}

static int
@@ -826,7 +826,7 @@ static void mbim_reset_function_queue(struct f_mbim *dev)
{
	struct ctrl_pkt	*cpkt = NULL;

	pr_debug("Queue empty packet for QBI");
	pr_debug("Queue empty packet for QBI\n");

	spin_lock(&dev->lock);

@@ -840,7 +840,7 @@ static void mbim_reset_function_queue(struct f_mbim *dev)
	list_add_tail(&cpkt->list, &dev->cpkt_req_q);
	spin_unlock(&dev->lock);

	pr_debug("%s: Wake up read queue", __func__);
	pr_debug("%s: Wake up read queue\n", __func__);
	wake_up(&dev->read_wq);
}

@@ -879,7 +879,7 @@ static void mbim_do_notify(struct f_mbim *mbim)
	struct usb_cdc_notification	*event;
	int				status;

	pr_debug("notify_state: %d", mbim->not_port.notify_state);
	pr_debug("notify_state: %d\n", mbim->not_port.notify_state);

	if (!req)
		return;
@@ -900,7 +900,7 @@ static void mbim_do_notify(struct f_mbim *mbim)
		pr_debug("Notification %02x sent\n", event->bNotificationType);

		if (atomic_read(&mbim->not_port.notify_count) <= 0) {
			pr_debug("notify_response_avaliable: done");
			pr_debug("notify_response_avaliable: done\n");
			return;
		}

@@ -909,7 +909,8 @@ static void mbim_do_notify(struct f_mbim *mbim)
		spin_lock(&mbim->lock);
		if (status) {
			atomic_dec(&mbim->not_port.notify_count);
			pr_err("Queue notify request failed, err: %d", status);
			pr_err("Queue notify request failed, err: %d\n",
					status);
		}

		return;
@@ -924,14 +925,14 @@ static void mbim_do_notify(struct f_mbim *mbim)
	 * so unlocking
	 */
	atomic_inc(&mbim->not_port.notify_count);
	pr_debug("queue request: notify_count = %d",
	pr_debug("queue request: notify_count = %d\n",
		atomic_read(&mbim->not_port.notify_count));
	spin_unlock(&mbim->lock);
	status = usb_ep_queue(mbim->not_port.notify, req, GFP_ATOMIC);
	spin_lock(&mbim->lock);
	if (status) {
		atomic_dec(&mbim->not_port.notify_count);
		pr_err("usb_ep_queue failed, err: %d", status);
		pr_err("usb_ep_queue failed, err: %d\n", status);
	}
}

@@ -946,7 +947,7 @@ static void mbim_notify_complete(struct usb_ep *ep, struct usb_request *req)
	switch (req->status) {
	case 0:
		atomic_dec(&mbim->not_port.notify_count);
		pr_debug("notify_count = %d",
		pr_debug("notify_count = %d\n",
			atomic_read(&mbim->not_port.notify_count));
		break;

@@ -955,7 +956,7 @@ static void mbim_notify_complete(struct usb_ep *ep, struct usb_request *req)
		/* connection gone */
		mbim->not_port.notify_state = MBIM_NOTIFY_NONE;
		atomic_set(&mbim->not_port.notify_count, 0);
		pr_info("ESHUTDOWN/ECONNRESET, connection gone");
		pr_info("ESHUTDOWN/ECONNRESET, connection gone\n");
		spin_unlock(&mbim->lock);
		mbim_clear_queues(mbim);
		mbim_reset_function_queue(mbim);
@@ -1058,7 +1059,7 @@ fmbim_cmd_complete(struct usb_ep *ep, struct usb_request *req)
	spin_unlock(&dev->lock);

	/* wakeup read thread */
	pr_debug("Wake up read queue");
	pr_debug("Wake up read queue\n");
	wake_up(&dev->read_wq);

	return;
@@ -1090,7 +1091,7 @@ mbim_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
	case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8)
		| USB_CDC_RESET_FUNCTION:

		pr_debug("USB_CDC_RESET_FUNCTION");
		pr_debug("USB_CDC_RESET_FUNCTION\n");
		value = 0;
		req->complete = fmbim_reset_cmd_complete;
		req->context = mbim;
@@ -1099,10 +1100,10 @@ mbim_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
	case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8)
		| USB_CDC_SEND_ENCAPSULATED_COMMAND:

		pr_debug("USB_CDC_SEND_ENCAPSULATED_COMMAND");
		pr_debug("USB_CDC_SEND_ENCAPSULATED_COMMAND\n");

		if (w_length > req->length) {
			pr_debug("w_length > req->length: %d > %d",
			pr_debug("w_length > req->length: %d > %d\n",
			w_length, req->length);
		}
		value = w_length;
@@ -1113,10 +1114,10 @@ mbim_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
	case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8)
		| USB_CDC_GET_ENCAPSULATED_RESPONSE:

		pr_debug("USB_CDC_GET_ENCAPSULATED_RESPONSE");
		pr_debug("USB_CDC_GET_ENCAPSULATED_RESPONSE\n");

		if (w_value) {
			pr_err("w_length > 0: %d", w_length);
			pr_err("w_length > 0: %d\n", w_length);
			break;
		}

@@ -1140,7 +1141,7 @@ mbim_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
		memcpy(req->buf, cpkt->buf, value);
		mbim_free_ctrl_pkt(cpkt);

		pr_debug("copied encapsulated_response %d bytes",
		pr_debug("copied encapsulated_response %d bytes\n",
			value);

		break;
@@ -1148,7 +1149,7 @@ mbim_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
	case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8)
		| USB_CDC_GET_NTB_PARAMETERS:

		pr_debug("USB_CDC_GET_NTB_PARAMETERS");
		pr_debug("USB_CDC_GET_NTB_PARAMETERS\n");

		if (w_length == 0 || w_value != 0 || w_index != mbim->ctrl_id)
			break;
@@ -1161,7 +1162,7 @@ mbim_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
	case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8)
		| USB_CDC_GET_NTB_INPUT_SIZE:

		pr_debug("USB_CDC_GET_NTB_INPUT_SIZE");
		pr_debug("USB_CDC_GET_NTB_INPUT_SIZE\n");

		if (w_length < 4 || w_value != 0 || w_index != mbim->ctrl_id)
			break;
@@ -1175,10 +1176,10 @@ mbim_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
	case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8)
		| USB_CDC_SET_NTB_INPUT_SIZE:

		pr_debug("USB_CDC_SET_NTB_INPUT_SIZE");
		pr_debug("USB_CDC_SET_NTB_INPUT_SIZE\n");

		if (w_length != 4 && w_length != 8) {
			pr_err("wrong NTB length %d", w_length);
			pr_err("wrong NTB length %d\n", w_length);
			break;
		}

@@ -1197,7 +1198,7 @@ mbim_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
	{
		uint16_t format;

		pr_debug("USB_CDC_GET_NTB_FORMAT");
		pr_debug("USB_CDC_GET_NTB_FORMAT\n");

		if (w_length < 2 || w_value != 0 || w_index != mbim->ctrl_id)
			break;
@@ -1212,7 +1213,7 @@ mbim_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
	case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8)
		| USB_CDC_SET_NTB_FORMAT:
	{
		pr_debug("USB_CDC_SET_NTB_FORMAT");
		pr_debug("USB_CDC_SET_NTB_FORMAT\n");

		if (w_length != 0 || w_index != mbim->ctrl_id)
			break;
@@ -1285,7 +1286,7 @@ static int mbim_ctrlrequest(struct usb_composite_dev *cdev,
	if (cdev->config || !mbim_ext_config_desc.function.subCompatibleID[0])
		return value;

	pr_debug("%02x.%02x v%04x i%04x l%u",
	pr_debug("%02x.%02x v%04x i%04x l%u\n",
			ctrl->bRequestType, ctrl->bRequest,
			w_value, w_index, w_length);

@@ -1317,7 +1318,7 @@ static int mbim_ctrlrequest(struct usb_composite_dev *cdev,
		cdev->req->length = value;
		rc = usb_ep_queue(cdev->gadget->ep0, cdev->req, GFP_ATOMIC);
		if (rc < 0)
			pr_err("response queue error: %d", rc);
			pr_err("response queue error: %d\n", rc);
	}
	return value;
}
@@ -1331,7 +1332,7 @@ static int mbim_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
	/* Control interface has only altsetting 0 */
	if (intf == mbim->ctrl_id) {

		pr_info("CONTROL_INTERFACE");
		pr_info("CONTROL_INTERFACE\n");

		if (alt != 0)
			goto fail;
@@ -1361,7 +1362,7 @@ static int mbim_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
	/* Data interface has two altsettings, 0 and 1 */
	} else if (intf == mbim->data_id) {

		pr_info("DATA_INTERFACE");
		pr_info("DATA_INTERFACE\n");

		if (alt > 1)
			goto fail;
@@ -1376,11 +1377,11 @@ static int mbim_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
		 * Changing altsettings resets filters, statistics, etc.
		 */
		if (alt == 1) {
			pr_info("Alt set 1, initialize ports");
			pr_info("Alt set 1, initialize ports\n");

			if (!mbim->bam_port.in->desc) {

				pr_info("Choose endpoints");
				pr_info("Choose endpoints\n");

				ret = config_ep_by_speed(cdev->gadget, f,
							mbim->bam_port.in);
@@ -1391,7 +1392,7 @@ static int mbim_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
					return ret;
				}

				pr_info("Set mbim port in_desc = 0x%p",
				pr_info("Set mbim port in_desc = 0x%p\n",
					mbim->bam_port.in->desc);

				ret = config_ep_by_speed(cdev->gadget, f,
@@ -1403,7 +1404,7 @@ static int mbim_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
					return ret;
				}

				pr_info("Set mbim port out_desc = 0x%p",
				pr_info("Set mbim port out_desc = 0x%p\n",
					mbim->bam_port.out->desc);

				if (mbim->xport == USB_GADGET_XPORT_BAM2BAM_IPA
@@ -1420,7 +1421,7 @@ static int mbim_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
				mbim_bam_connect(mbim);

			} else {
				pr_info("PORTS already SET");
				pr_info("PORTS already SET\n");
			}
		}

@@ -1434,12 +1435,12 @@ static int mbim_set_alt(struct usb_function *f, unsigned intf, unsigned alt)

	atomic_set(&mbim->online, 1);

	pr_info("SET DEVICE ONLINE");
	pr_info("SET DEVICE ONLINE\n");

	return 0;

fail:
	pr_err("ERROR: Illegal Interface");
	pr_err("ERROR: Illegal Interface\n");
	return -EINVAL;
}

@@ -1464,7 +1465,7 @@ static void mbim_disable(struct usb_function *f)
	struct f_mbim	*mbim = func_to_mbim(f);
	struct usb_composite_dev *cdev = mbim->cdev;

	pr_info("SET DEVICE OFFLINE");
	pr_info("SET DEVICE OFFLINE\n");
	atomic_set(&mbim->online, 0);

	mbim->not_port.notify_state = MBIM_NOTIFY_NONE;
@@ -1540,7 +1541,7 @@ mbim_bind(struct usb_configuration *c, struct usb_function *f)
	int			status;
	struct usb_ep		*ep;

	pr_info("Enter");
	pr_info("Enter\n");

	mbim->cdev = cdev;

@@ -1659,7 +1660,7 @@ mbim_bind(struct usb_configuration *c, struct usb_function *f)
	 * subCompatibleID field. Windows only supports up to config #4.
	 */
	if (c->bConfigurationValue >= 2 && c->bConfigurationValue <= 4) {
		pr_debug("MBIM in configuration %d", c->bConfigurationValue);
		pr_debug("MBIM in configuration %d\n", c->bConfigurationValue);
		mbim_ext_config_desc.function.subCompatibleID[0] =
			c->bConfigurationValue + '0';
	}
@@ -1703,7 +1704,7 @@ static void mbim_unbind(struct usb_configuration *c, struct usb_function *f)
{
	struct f_mbim	*mbim = func_to_mbim(f);

	pr_debug("unbinding mbim");
	pr_debug("unbinding mbim\n");
	bam_data_destroy(mbim->port_num);

	if (gadget_is_superspeed(c->cdev->gadget))
@@ -1732,17 +1733,17 @@ int mbim_bind_config(struct usb_configuration *c, unsigned portno,
	int status = 0;
	int mbim_out_max_size;

	pr_info("port number %u", portno);
	pr_info("port number %u\n", portno);

	if (portno >= nr_mbim_ports) {
		pr_err("Can not add port %u. Max ports = %d",
		pr_err("Can not add port %u. Max ports = %d\n",
		       portno, nr_mbim_ports);
		return -ENODEV;
	}

	status = mbim_bam_setup(nr_mbim_ports);
	if (status) {
		pr_err("bam setup failed");
		pr_err("bam setup failed\n");
		return status;
	}

@@ -1768,7 +1769,7 @@ int mbim_bind_config(struct usb_configuration *c, unsigned portno,
	/* allocate and initialize one new instance */
	mbim = mbim_ports[0].port;
	if (!mbim) {
		pr_info("mbim struct not allocated");
		pr_info("mbim struct not allocated\n");
		return -ENOMEM;
	}

@@ -1819,7 +1820,7 @@ int mbim_bind_config(struct usb_configuration *c, unsigned portno,

	status = usb_add_function(c, &mbim->function);

	pr_info("Exit status %d", status);
	pr_info("Exit status %d\n", status);

	return status;
}
@@ -1908,7 +1909,7 @@ mbim_write(struct file *fp, const char __user *buf, size_t count, loff_t *pos)
	struct ctrl_pkt *cpkt = NULL;
	int ret = 0;

	pr_debug("Enter(%zu)", count);
	pr_debug("Enter(%zu)\n", count);

	if (!dev) {
		pr_err("Received NULL mbim pointer\n");
@@ -1956,7 +1957,7 @@ mbim_write(struct file *fp, const char __user *buf, size_t count, loff_t *pos)

	mbim_unlock(&dev->write_excl);

	pr_debug("Exit(%zu)", count);
	pr_debug("Exit(%zu)\n", count);

	return count;

@@ -1992,7 +1993,7 @@ static int mbim_open(struct inode *ip, struct file *fp)

static int mbim_release(struct inode *ip, struct file *fp)
{
	pr_info("Close mbim file");
	pr_info("Close mbim file\n");

	mbim_unlock(&_mbim_dev->open_excl);

@@ -2006,10 +2007,10 @@ static long mbim_ioctl(struct file *fp, unsigned cmd, unsigned long arg)
	struct mbim_ipa_ep_info info;
	int ret = 0;

	pr_debug("Received command %d", cmd);
	pr_debug("Received command %d\n", cmd);

	if (!mbim) {
		pr_err("Bad parameter");
		pr_err("Bad parameter\n");
		return -EINVAL;
	}

@@ -2021,20 +2022,20 @@ static long mbim_ioctl(struct file *fp, unsigned cmd, unsigned long arg)
		ret = copy_to_user((void __user *)arg,
			&mbim->ntb_input_size, sizeof(mbim->ntb_input_size));
		if (ret) {
			pr_err("copying to user space failed");
			pr_err("copying to user space failed\n");
			ret = -EFAULT;
		}
		pr_info("Sent NTB size %d", mbim->ntb_input_size);
		pr_info("Sent NTB size %d\n", mbim->ntb_input_size);
		break;
	case MBIM_GET_DATAGRAM_COUNT:
		ret = copy_to_user((void __user *)arg,
			&mbim->ntb_max_datagrams,
			sizeof(mbim->ntb_max_datagrams));
		if (ret) {
			pr_err("copying to user space failed");
			pr_err("copying to user space failed\n");
			ret = -EFAULT;
		}
		pr_info("Sent NTB datagrams count %d",
		pr_info("Sent NTB datagrams count %d\n",
			mbim->ntb_max_datagrams);
		break;

@@ -2047,7 +2048,7 @@ static long mbim_ioctl(struct file *fp, unsigned cmd, unsigned long arg)
		port = &mbim->bam_port;
		if ((port->ipa_producer_ep == -1) ||
			(port->ipa_consumer_ep == -1)) {
			pr_err("EP_LOOKUP failed - IPA pipes were not updated");
			pr_err("EP_LOOKUP failed - IPA pipes not updated\n");
			ret = -EAGAIN;
			break;
		}
@@ -2060,13 +2061,13 @@ static long mbim_ioctl(struct file *fp, unsigned cmd, unsigned long arg)
		ret = copy_to_user((void __user *)arg, &info,
			sizeof(info));
		if (ret) {
			pr_err("copying to user space failed");
			pr_err("copying to user space failed\n");
			ret = -EFAULT;
		}
		break;

	default:
		pr_err("wrong parameter");
		pr_err("wrong parameter\n");
		ret = -EINVAL;
	}

@@ -2137,7 +2138,7 @@ static int mbim_init(int instances)
	_mbim_dev = dev;
	ret = misc_register(&mbim_device);
	if (ret) {
		pr_err("mbim driver failed to register");
		pr_err("mbim driver failed to register\n");
		goto fail_probe;
	}

@@ -2146,7 +2147,7 @@ static int mbim_init(int instances)
	return ret;

fail_probe:
	pr_err("Failed");
	pr_err("Failed\n");
	for (i = 0; i < nr_mbim_ports; i++) {
		kfree(mbim_ports[i].port);
		mbim_ports[i].port = NULL;
@@ -2159,7 +2160,7 @@ static void fmbim_cleanup(void)
{
	int i = 0;

	pr_info("Enter");
	pr_info("Enter\n");

	for (i = 0; i < nr_mbim_ports; i++) {
		kfree(mbim_ports[i].port);
+5 −5
Original line number Diff line number Diff line
@@ -1056,7 +1056,7 @@ ecm_qc_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],

	status = ecm_qc_bam_setup();
	if (status) {
		pr_err("bam setup failed");
		pr_err("bam setup failed\n");
		return status;
	}

@@ -1093,7 +1093,7 @@ ecm_qc_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
		return -ENOMEM;

	ecm->xport = str_to_xport(xport_name);
	pr_debug("set xport = %d", ecm->xport);
	pr_debug("set xport = %d\n", ecm->xport);

	/* export host's Ethernet address in CDC format */
	if (ecm->xport == USB_GADGET_XPORT_BAM2BAM_IPA) {
@@ -1128,7 +1128,7 @@ ecm_qc_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],

	status = usb_add_function(c, &ecm->port.func);
	if (status) {
		pr_err("failed to add function");
		pr_err("failed to add function\n");
		ecm_qc_string_defs[1].s = NULL;
		kfree(ecm);
		return status;
@@ -1141,11 +1141,11 @@ ecm_qc_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
			ipa_params.host_ethaddr, ipa_params.device_ethaddr);
	status = ecm_ipa_init(&ipa_params);
	if (status) {
		pr_err("failed to initialize ecm_ipa");
		pr_err("failed to initialize ecm_ipa\n");
		ecm_qc_string_defs[1].s = NULL;
		kfree(ecm);
	} else {
		pr_debug("ecm_ipa successful created");
		pr_debug("ecm_ipa successful created\n");
	}

	return status;
+11 −11
Original line number Diff line number Diff line
@@ -1027,7 +1027,7 @@ rndis_qc_unbind(struct usb_configuration *c, struct usb_function *f)
{
	struct f_rndis_qc		*rndis = func_to_rndis_qc(f);

	pr_debug("rndis_qc_unbind: free");
	pr_debug("rndis_qc_unbind: free\n");
	bam_data_destroy(0);
	rndis_deregister(rndis->config);
	rndis_exit();
@@ -1143,7 +1143,7 @@ rndis_qc_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
	if (rndis->xport == USB_GADGET_XPORT_BAM2BAM_IPA) {
		gether_qc_get_macs(rndis_ipa_params.device_ethaddr,
				rndis_ipa_params.host_ethaddr);
		pr_debug("setting host_ethaddr=%pM, device_ethaddr=%pM",
		pr_debug("setting host_ethaddr=%pM, device_ethaddr=%pM\n",
			rndis_ipa_params.host_ethaddr,
			rndis_ipa_params.device_ethaddr);
		rndis_ipa_supported = true;
@@ -1246,7 +1246,7 @@ static int rndis_qc_release_dev(struct inode *ip, struct file *fp)
{
	struct f_rndis_qc	*rndis = fp->private_data;

	pr_info("Close rndis QC file");
	pr_info("Close rndis QC file\n");
	rndis_qc_unlock(&rndis->open_excl);

	return 0;
@@ -1257,7 +1257,7 @@ static long rndis_qc_ioctl(struct file *fp, unsigned cmd, unsigned long arg)
	struct f_rndis_qc	*rndis = fp->private_data;
	int ret = 0;

	pr_info("Received command %d", cmd);
	pr_info("Received command %d\n", cmd);

	if (rndis_qc_lock(&rndis->ioctl_excl))
		return -EBUSY;
@@ -1268,10 +1268,10 @@ static long rndis_qc_ioctl(struct file *fp, unsigned cmd, unsigned long arg)
					&rndis->max_pkt_per_xfer,
					sizeof(rndis->max_pkt_per_xfer));
		if (ret) {
			pr_err("copying to user space failed");
			pr_err("copying to user space failed\n");
			ret = -EFAULT;
		}
		pr_info("Sent max packets per xfer %d",
		pr_info("Sent max packets per xfer %d\n",
				rndis->max_pkt_per_xfer);
		break;
	case RNDIS_QC_GET_MAX_PKT_SIZE:
@@ -1279,14 +1279,14 @@ static long rndis_qc_ioctl(struct file *fp, unsigned cmd, unsigned long arg)
					&rndis->max_pkt_size,
					sizeof(rndis->max_pkt_size));
		if (ret) {
			pr_err("copying to user space failed");
			pr_err("copying to user space failed\n");
			ret = -EFAULT;
		}
		pr_debug("Sent max packet size %d",
		pr_debug("Sent max packet size %d\n",
				rndis->max_pkt_size);
		break;
	default:
		pr_err("Unsupported IOCTL");
		pr_err("Unsupported IOCTL\n");
		ret = -EINVAL;
	}

@@ -1316,14 +1316,14 @@ static int rndis_qc_init(void)

	ret = misc_register(&rndis_qc_device);
	if (ret)
		pr_err("rndis QC driver failed to register");
		pr_err("rndis QC driver failed to register\n");

	return ret;
}

static void rndis_qc_cleanup(void)
{
	pr_info("rndis QC cleanup");
	pr_info("rndis QC cleanup\n");

	misc_deregister(&rndis_qc_device);
	_rndis_qc = NULL;
+4 −4
Original line number Diff line number Diff line
@@ -1048,7 +1048,7 @@ frmnet_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
			| USB_CDC_GET_ENCAPSULATED_RESPONSE:
		pr_debug("%s: USB_CDC_GET_ENCAPSULATED_RESPONSE\n", __func__);
		if (w_value) {
			pr_err("%s: invalid w_value = %04x",
			pr_err("%s: invalid w_value = %04x\n",
				   __func__ , w_value);
			goto invalid;
		} else {
@@ -1119,7 +1119,7 @@ static int frmnet_bind(struct usb_configuration *c, struct usb_function *f)
	pr_debug("%s: start binding\n", __func__);
	dev->ifc_id = usb_interface_id(c, f);
	if (dev->ifc_id < 0) {
		pr_err("%s: unable to allocate ifc id, err:%d",
		pr_err("%s: unable to allocate ifc id, err:%d\n",
				__func__, dev->ifc_id);
		return dev->ifc_id;
	}
@@ -1251,7 +1251,7 @@ static int frmnet_bind_config(struct usb_configuration *c, unsigned portno)
	pr_debug("%s: usb config:%p\n", __func__, c);

	if (portno >= nr_rmnet_ports) {
		pr_err("%s: supporting ports#%u port_id:%u", __func__,
		pr_err("%s: supporting ports#%u port_id:%u\n", __func__,
				nr_rmnet_ports, portno);
		return -ENODEV;
	}