|
@@ -547,7 +547,7 @@ out:
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-static int uvcg_control_class_drop_link(struct config_item *src,
|
|
|
|
|
|
+static void uvcg_control_class_drop_link(struct config_item *src,
|
|
struct config_item *target)
|
|
struct config_item *target)
|
|
{
|
|
{
|
|
struct config_item *control, *header;
|
|
struct config_item *control, *header;
|
|
@@ -555,7 +555,6 @@ static int uvcg_control_class_drop_link(struct config_item *src,
|
|
struct mutex *su_mutex = &src->ci_group->cg_subsys->su_mutex;
|
|
struct mutex *su_mutex = &src->ci_group->cg_subsys->su_mutex;
|
|
struct uvc_descriptor_header **class_array;
|
|
struct uvc_descriptor_header **class_array;
|
|
struct uvcg_control_header *target_hdr;
|
|
struct uvcg_control_header *target_hdr;
|
|
- int ret = -EINVAL;
|
|
|
|
|
|
|
|
mutex_lock(su_mutex); /* for navigating configfs hierarchy */
|
|
mutex_lock(su_mutex); /* for navigating configfs hierarchy */
|
|
|
|
|
|
@@ -569,23 +568,17 @@ static int uvcg_control_class_drop_link(struct config_item *src,
|
|
mutex_lock(&opts->lock);
|
|
mutex_lock(&opts->lock);
|
|
|
|
|
|
class_array = uvcg_get_ctl_class_arr(src, opts);
|
|
class_array = uvcg_get_ctl_class_arr(src, opts);
|
|
- if (!class_array)
|
|
|
|
- goto unlock;
|
|
|
|
- if (opts->refcnt) {
|
|
|
|
- ret = -EBUSY;
|
|
|
|
|
|
+ if (!class_array || opts->refcnt)
|
|
goto unlock;
|
|
goto unlock;
|
|
- }
|
|
|
|
|
|
|
|
target_hdr = to_uvcg_control_header(target);
|
|
target_hdr = to_uvcg_control_header(target);
|
|
--target_hdr->linked;
|
|
--target_hdr->linked;
|
|
class_array[0] = NULL;
|
|
class_array[0] = NULL;
|
|
- ret = 0;
|
|
|
|
|
|
|
|
unlock:
|
|
unlock:
|
|
mutex_unlock(&opts->lock);
|
|
mutex_unlock(&opts->lock);
|
|
out:
|
|
out:
|
|
mutex_unlock(su_mutex);
|
|
mutex_unlock(su_mutex);
|
|
- return ret;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static struct configfs_item_operations uvcg_control_class_item_ops = {
|
|
static struct configfs_item_operations uvcg_control_class_item_ops = {
|
|
@@ -777,7 +770,7 @@ out:
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-static int uvcg_streaming_header_drop_link(struct config_item *src,
|
|
|
|
|
|
+static void uvcg_streaming_header_drop_link(struct config_item *src,
|
|
struct config_item *target)
|
|
struct config_item *target)
|
|
{
|
|
{
|
|
struct mutex *su_mutex = &src->ci_group->cg_subsys->su_mutex;
|
|
struct mutex *su_mutex = &src->ci_group->cg_subsys->su_mutex;
|
|
@@ -786,7 +779,6 @@ static int uvcg_streaming_header_drop_link(struct config_item *src,
|
|
struct uvcg_streaming_header *src_hdr;
|
|
struct uvcg_streaming_header *src_hdr;
|
|
struct uvcg_format *target_fmt = NULL;
|
|
struct uvcg_format *target_fmt = NULL;
|
|
struct uvcg_format_ptr *format_ptr, *tmp;
|
|
struct uvcg_format_ptr *format_ptr, *tmp;
|
|
- int ret = -EINVAL;
|
|
|
|
|
|
|
|
src_hdr = to_uvcg_streaming_header(src);
|
|
src_hdr = to_uvcg_streaming_header(src);
|
|
mutex_lock(su_mutex); /* for navigating configfs hierarchy */
|
|
mutex_lock(su_mutex); /* for navigating configfs hierarchy */
|
|
@@ -811,8 +803,6 @@ static int uvcg_streaming_header_drop_link(struct config_item *src,
|
|
out:
|
|
out:
|
|
mutex_unlock(&opts->lock);
|
|
mutex_unlock(&opts->lock);
|
|
mutex_unlock(su_mutex);
|
|
mutex_unlock(su_mutex);
|
|
- return ret;
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static struct configfs_item_operations uvcg_streaming_header_item_ops = {
|
|
static struct configfs_item_operations uvcg_streaming_header_item_ops = {
|
|
@@ -2051,7 +2041,7 @@ out:
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-static int uvcg_streaming_class_drop_link(struct config_item *src,
|
|
|
|
|
|
+static void uvcg_streaming_class_drop_link(struct config_item *src,
|
|
struct config_item *target)
|
|
struct config_item *target)
|
|
{
|
|
{
|
|
struct config_item *streaming, *header;
|
|
struct config_item *streaming, *header;
|
|
@@ -2059,7 +2049,6 @@ static int uvcg_streaming_class_drop_link(struct config_item *src,
|
|
struct mutex *su_mutex = &src->ci_group->cg_subsys->su_mutex;
|
|
struct mutex *su_mutex = &src->ci_group->cg_subsys->su_mutex;
|
|
struct uvc_descriptor_header ***class_array;
|
|
struct uvc_descriptor_header ***class_array;
|
|
struct uvcg_streaming_header *target_hdr;
|
|
struct uvcg_streaming_header *target_hdr;
|
|
- int ret = -EINVAL;
|
|
|
|
|
|
|
|
mutex_lock(su_mutex); /* for navigating configfs hierarchy */
|
|
mutex_lock(su_mutex); /* for navigating configfs hierarchy */
|
|
|
|
|
|
@@ -2076,23 +2065,19 @@ static int uvcg_streaming_class_drop_link(struct config_item *src,
|
|
if (!class_array || !*class_array)
|
|
if (!class_array || !*class_array)
|
|
goto unlock;
|
|
goto unlock;
|
|
|
|
|
|
- if (opts->refcnt) {
|
|
|
|
- ret = -EBUSY;
|
|
|
|
|
|
+ if (opts->refcnt)
|
|
goto unlock;
|
|
goto unlock;
|
|
- }
|
|
|
|
|
|
|
|
target_hdr = to_uvcg_streaming_header(target);
|
|
target_hdr = to_uvcg_streaming_header(target);
|
|
--target_hdr->linked;
|
|
--target_hdr->linked;
|
|
kfree(**class_array);
|
|
kfree(**class_array);
|
|
kfree(*class_array);
|
|
kfree(*class_array);
|
|
*class_array = NULL;
|
|
*class_array = NULL;
|
|
- ret = 0;
|
|
|
|
|
|
|
|
unlock:
|
|
unlock:
|
|
mutex_unlock(&opts->lock);
|
|
mutex_unlock(&opts->lock);
|
|
out:
|
|
out:
|
|
mutex_unlock(su_mutex);
|
|
mutex_unlock(su_mutex);
|
|
- return ret;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static struct configfs_item_operations uvcg_streaming_class_item_ops = {
|
|
static struct configfs_item_operations uvcg_streaming_class_item_ops = {
|