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

Commit 2c2e30e5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_cdev: Remove func_name and port_num attributes"

parents 0c1bf6e6 40ea4087
Loading
Loading
Loading
Loading
+7 −15
Original line number Diff line number Diff line
@@ -50,6 +50,9 @@
#define MODULE_NAME "msm_usb_bridge"
#define NUM_INSTANCE 2

#define MAX_CDEV_INST_NAME	15
#define MAX_CDEV_FUNC_NAME	5

#define BRIDGE_RX_QUEUE_SIZE	8
#define BRIDGE_RX_BUF_SIZE	2048
#define BRIDGE_TX_QUEUE_SIZE	8
@@ -1647,16 +1650,6 @@ static struct configfs_item_operations cserial_item_ops = {
	.release	= cserial_attr_release,
};

static ssize_t usb_cser_port_num_show(struct config_item *item, char *page)
{
	return sprintf(page, "%u\n", to_f_cdev_opts(item)->port_num);
}

static ssize_t usb_cser_func_name_show(struct config_item *item, char *page)
{
	return sprintf(page, "%s\n", to_f_cdev_opts(item)->func_name);
}

static ssize_t usb_cser_status_show(struct config_item *item, char *page)
{
	struct f_cdev *port = to_f_cdev_opts(item)->port;
@@ -1722,12 +1715,8 @@ static ssize_t usb_cser_status_store(struct config_item *item,
	return len;
}

CONFIGFS_ATTR_RO(usb_cser_, port_num);
CONFIGFS_ATTR_RO(usb_cser_, func_name);
CONFIGFS_ATTR(usb_cser_, status);
static struct configfs_attribute *cserial_attrs[] = {
	&usb_cser_attr_port_num,
	&usb_cser_attr_func_name,
	&usb_cser_attr_status,
	NULL,
};
@@ -1748,7 +1737,7 @@ static int cser_set_inst_name(struct usb_function_instance *f, const char *name)
	struct f_cdev *port;

	name_len = strlen(name) + 1;
	if (name_len > 15)
	if (name_len > MAX_CDEV_INST_NAME)
		return -ENAMETOOLONG;

	/* expect name as cdev.<func>.<port_num> */
@@ -1760,6 +1749,9 @@ static int cser_set_inst_name(struct usb_function_instance *f, const char *name)

	/* get function name */
	str_size = name_len - strlen(str);
	if (str_size > MAX_CDEV_FUNC_NAME)
		return -ENAMETOOLONG;

	ptr = kstrndup(name, str_size - 1, GFP_KERNEL);
	if (!ptr) {
		pr_err("error:%ld\n", PTR_ERR(ptr));