Merge tag 'configfs-for-4.10' of git://git.infradead.org/users/hch/configfs
Pull configfs update from Christoph Hellwig: "Just one simple change from Andrzej to drop the pointless return value from the ->drop_link method" * tag 'configfs-for-4.10' of git://git.infradead.org/users/hch/configfs: fs: configfs: don't return anything from drop_link
This commit is contained in:
@@ -547,7 +547,7 @@ out:
|
||||
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 *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 uvc_descriptor_header **class_array;
|
||||
struct uvcg_control_header *target_hdr;
|
||||
int ret = -EINVAL;
|
||||
|
||||
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);
|
||||
|
||||
class_array = uvcg_get_ctl_class_arr(src, opts);
|
||||
if (!class_array)
|
||||
if (!class_array || opts->refcnt)
|
||||
goto unlock;
|
||||
if (opts->refcnt) {
|
||||
ret = -EBUSY;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
target_hdr = to_uvcg_control_header(target);
|
||||
--target_hdr->linked;
|
||||
class_array[0] = NULL;
|
||||
ret = 0;
|
||||
|
||||
unlock:
|
||||
mutex_unlock(&opts->lock);
|
||||
out:
|
||||
mutex_unlock(su_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct configfs_item_operations uvcg_control_class_item_ops = {
|
||||
@@ -777,7 +770,7 @@ out:
|
||||
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 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_format *target_fmt = NULL;
|
||||
struct uvcg_format_ptr *format_ptr, *tmp;
|
||||
int ret = -EINVAL;
|
||||
|
||||
src_hdr = to_uvcg_streaming_header(src);
|
||||
mutex_lock(su_mutex); /* for navigating configfs hierarchy */
|
||||
@@ -811,8 +803,6 @@ static int uvcg_streaming_header_drop_link(struct config_item *src,
|
||||
out:
|
||||
mutex_unlock(&opts->lock);
|
||||
mutex_unlock(su_mutex);
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static struct configfs_item_operations uvcg_streaming_header_item_ops = {
|
||||
@@ -2051,7 +2041,7 @@ out:
|
||||
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 *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 uvc_descriptor_header ***class_array;
|
||||
struct uvcg_streaming_header *target_hdr;
|
||||
int ret = -EINVAL;
|
||||
|
||||
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)
|
||||
goto unlock;
|
||||
|
||||
if (opts->refcnt) {
|
||||
ret = -EBUSY;
|
||||
if (opts->refcnt)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
target_hdr = to_uvcg_streaming_header(target);
|
||||
--target_hdr->linked;
|
||||
kfree(**class_array);
|
||||
kfree(*class_array);
|
||||
*class_array = NULL;
|
||||
ret = 0;
|
||||
|
||||
unlock:
|
||||
mutex_unlock(&opts->lock);
|
||||
out:
|
||||
mutex_unlock(su_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct configfs_item_operations uvcg_streaming_class_item_ops = {
|
||||
|
Reference in New Issue
Block a user