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

Commit a5c71262 authored by Ajay Agarwal's avatar Ajay Agarwal Committed by Gerrit - the friendly Code Review server
Browse files

Revert "usb: gadget: Add check gadget function bind or not"



This reverts commit fbbccfe9d3d66aa791177cdce0af9c5d0ace99a5.

Remove opts->bound check from configfs node show/store operations
in order to make them usable.

Change-Id: Iac2c46899b02a8c3a55a04929108d4d65e880869
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 19d3a743
Loading
Loading
Loading
Loading
+0 −35
Original line number Diff line number Diff line
@@ -35,11 +35,6 @@
		struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item);	\
		int result;						\
									\
		if (opts->bound == false) {		\
			pr_err("Gadget function do not bind yet.\n");	\
			return -ENODEV;			\
		}							\
									\
		mutex_lock(&opts->lock);				\
		result = gether_get_dev_addr(opts->net, page, PAGE_SIZE); \
		mutex_unlock(&opts->lock);				\
@@ -53,11 +48,6 @@
		struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item);	\
		int ret;						\
									\
		if (opts->bound == false) {		\
			pr_err("Gadget function do not bind yet.\n");	\
			return -ENODEV;			\
		}							\
									\
		mutex_lock(&opts->lock);				\
		if (opts->refcnt) {					\
			mutex_unlock(&opts->lock);			\
@@ -80,11 +70,6 @@
		struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item);	\
		int result;						\
									\
		if (opts->bound == false) {		\
			pr_err("Gadget function do not bind yet.\n");	\
			return -ENODEV;			\
		}							\
									\
		mutex_lock(&opts->lock);				\
		result = gether_get_host_addr(opts->net, page, PAGE_SIZE); \
		mutex_unlock(&opts->lock);				\
@@ -98,11 +83,6 @@
		struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item);	\
		int ret;						\
									\
		if (opts->bound == false) {		\
			pr_err("Gadget function do not bind yet.\n");	\
			return -ENODEV;			\
		}							\
									\
		mutex_lock(&opts->lock);				\
		if (opts->refcnt) {					\
			mutex_unlock(&opts->lock);			\
@@ -125,11 +105,6 @@
		struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item);	\
		unsigned qmult;						\
									\
		if (opts->bound == false) {		\
			pr_err("Gadget function do not bind yet.\n");	\
			return -ENODEV;			\
		}							\
									\
		mutex_lock(&opts->lock);				\
		qmult = gether_get_qmult(opts->net);			\
		mutex_unlock(&opts->lock);				\
@@ -143,11 +118,6 @@
		u8 val;							\
		int ret;						\
									\
		if (opts->bound == false) {		\
			pr_err("Gadget function do not bind yet.\n");	\
			return -ENODEV;			\
		}							\
									\
		mutex_lock(&opts->lock);				\
		if (opts->refcnt) {					\
			ret = -EBUSY;					\
@@ -174,11 +144,6 @@ out: \
		struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item);	\
		int ret;						\
									\
		if (opts->bound == false) {		\
			pr_err("Gadget function do not bind yet.\n");	\
			return -ENODEV;			\
		}							\
									\
		mutex_lock(&opts->lock);				\
		ret = gether_get_ifname(opts->net, page, PAGE_SIZE);	\
		mutex_unlock(&opts->lock);				\