Skip to content

Commit 84b6079

Browse files
committed
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
2 parents 5084fdf + e16769d commit 84b6079

File tree

6 files changed

+17
-37
lines changed

6 files changed

+17
-37
lines changed

Documentation/filesystems/configfs/configfs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ among other things. For that, it needs a type.
174174
void (*release)(struct config_item *);
175175
int (*allow_link)(struct config_item *src,
176176
struct config_item *target);
177-
int (*drop_link)(struct config_item *src,
177+
void (*drop_link)(struct config_item *src,
178178
struct config_item *target);
179179
};
180180

drivers/nvme/target/configfs.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ static int nvmet_port_subsys_allow_link(struct config_item *parent,
480480
return ret;
481481
}
482482

483-
static int nvmet_port_subsys_drop_link(struct config_item *parent,
483+
static void nvmet_port_subsys_drop_link(struct config_item *parent,
484484
struct config_item *target)
485485
{
486486
struct nvmet_port *port = to_nvmet_port(parent->ci_parent);
@@ -493,7 +493,7 @@ static int nvmet_port_subsys_drop_link(struct config_item *parent,
493493
goto found;
494494
}
495495
up_write(&nvmet_config_sem);
496-
return -EINVAL;
496+
return;
497497

498498
found:
499499
list_del(&p->entry);
@@ -502,7 +502,6 @@ static int nvmet_port_subsys_drop_link(struct config_item *parent,
502502
nvmet_disable_port(port);
503503
up_write(&nvmet_config_sem);
504504
kfree(p);
505-
return 0;
506505
}
507506

508507
static struct configfs_item_operations nvmet_port_subsys_item_ops = {
@@ -556,7 +555,7 @@ static int nvmet_allowed_hosts_allow_link(struct config_item *parent,
556555
return ret;
557556
}
558557

559-
static int nvmet_allowed_hosts_drop_link(struct config_item *parent,
558+
static void nvmet_allowed_hosts_drop_link(struct config_item *parent,
560559
struct config_item *target)
561560
{
562561
struct nvmet_subsys *subsys = to_subsys(parent->ci_parent);
@@ -569,14 +568,13 @@ static int nvmet_allowed_hosts_drop_link(struct config_item *parent,
569568
goto found;
570569
}
571570
up_write(&nvmet_config_sem);
572-
return -EINVAL;
571+
return;
573572

574573
found:
575574
list_del(&p->entry);
576575
nvmet_genctr++;
577576
up_write(&nvmet_config_sem);
578577
kfree(p);
579-
return 0;
580578
}
581579

582580
static struct configfs_item_operations nvmet_allowed_hosts_item_ops = {

drivers/target/target_core_fabric_configfs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static int target_fabric_mappedlun_link(
137137
return core_dev_add_initiator_node_lun_acl(se_tpg, lacl, lun, lun_access_ro);
138138
}
139139

140-
static int target_fabric_mappedlun_unlink(
140+
static void target_fabric_mappedlun_unlink(
141141
struct config_item *lun_acl_ci,
142142
struct config_item *lun_ci)
143143
{
@@ -146,7 +146,7 @@ static int target_fabric_mappedlun_unlink(
146146
struct se_lun *lun = container_of(to_config_group(lun_ci),
147147
struct se_lun, lun_group);
148148

149-
return core_dev_del_initiator_node_lun_acl(lun, lacl);
149+
core_dev_del_initiator_node_lun_acl(lun, lacl);
150150
}
151151

152152
static struct se_lun_acl *item_to_lun_acl(struct config_item *item)
@@ -669,7 +669,7 @@ static int target_fabric_port_link(
669669
return ret;
670670
}
671671

672-
static int target_fabric_port_unlink(
672+
static void target_fabric_port_unlink(
673673
struct config_item *lun_ci,
674674
struct config_item *se_dev_ci)
675675
{
@@ -688,7 +688,6 @@ static int target_fabric_port_unlink(
688688
}
689689

690690
core_dev_del_lun(se_tpg, lun);
691-
return 0;
692691
}
693692

694693
static void target_fabric_port_release(struct config_item *item)

drivers/usb/gadget/configfs.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ static int config_usb_cfg_link(
408408
return ret;
409409
}
410410

411-
static int config_usb_cfg_unlink(
411+
static void config_usb_cfg_unlink(
412412
struct config_item *usb_cfg_ci,
413413
struct config_item *usb_func_ci)
414414
{
@@ -437,12 +437,11 @@ static int config_usb_cfg_unlink(
437437
list_del(&f->list);
438438
usb_put_function(f);
439439
mutex_unlock(&gi->lock);
440-
return 0;
440+
return;
441441
}
442442
}
443443
mutex_unlock(&gi->lock);
444444
WARN(1, "Unable to locate function to unbind\n");
445-
return 0;
446445
}
447446

448447
static struct configfs_item_operations gadget_config_item_ops = {
@@ -865,7 +864,7 @@ static int os_desc_link(struct config_item *os_desc_ci,
865864
return ret;
866865
}
867866

868-
static int os_desc_unlink(struct config_item *os_desc_ci,
867+
static void os_desc_unlink(struct config_item *os_desc_ci,
869868
struct config_item *usb_cfg_ci)
870869
{
871870
struct gadget_info *gi = container_of(to_config_group(os_desc_ci),
@@ -878,7 +877,6 @@ static int os_desc_unlink(struct config_item *os_desc_ci,
878877
cdev->os_desc_config = NULL;
879878
WARN_ON(gi->composite.gadget_driver.udc_name);
880879
mutex_unlock(&gi->lock);
881-
return 0;
882880
}
883881

884882
static struct configfs_item_operations os_desc_ops = {

drivers/usb/gadget/function/uvc_configfs.c

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -547,15 +547,14 @@ static int uvcg_control_class_allow_link(struct config_item *src,
547547
return ret;
548548
}
549549

550-
static int uvcg_control_class_drop_link(struct config_item *src,
550+
static void uvcg_control_class_drop_link(struct config_item *src,
551551
struct config_item *target)
552552
{
553553
struct config_item *control, *header;
554554
struct f_uvc_opts *opts;
555555
struct mutex *su_mutex = &src->ci_group->cg_subsys->su_mutex;
556556
struct uvc_descriptor_header **class_array;
557557
struct uvcg_control_header *target_hdr;
558-
int ret = -EINVAL;
559558

560559
mutex_lock(su_mutex); /* for navigating configfs hierarchy */
561560

@@ -569,23 +568,17 @@ static int uvcg_control_class_drop_link(struct config_item *src,
569568
mutex_lock(&opts->lock);
570569

571570
class_array = uvcg_get_ctl_class_arr(src, opts);
572-
if (!class_array)
573-
goto unlock;
574-
if (opts->refcnt) {
575-
ret = -EBUSY;
571+
if (!class_array || opts->refcnt)
576572
goto unlock;
577-
}
578573

579574
target_hdr = to_uvcg_control_header(target);
580575
--target_hdr->linked;
581576
class_array[0] = NULL;
582-
ret = 0;
583577

584578
unlock:
585579
mutex_unlock(&opts->lock);
586580
out:
587581
mutex_unlock(su_mutex);
588-
return ret;
589582
}
590583

591584
static struct configfs_item_operations uvcg_control_class_item_ops = {
@@ -777,7 +770,7 @@ static int uvcg_streaming_header_allow_link(struct config_item *src,
777770
return ret;
778771
}
779772

780-
static int uvcg_streaming_header_drop_link(struct config_item *src,
773+
static void uvcg_streaming_header_drop_link(struct config_item *src,
781774
struct config_item *target)
782775
{
783776
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,
786779
struct uvcg_streaming_header *src_hdr;
787780
struct uvcg_format *target_fmt = NULL;
788781
struct uvcg_format_ptr *format_ptr, *tmp;
789-
int ret = -EINVAL;
790782

791783
src_hdr = to_uvcg_streaming_header(src);
792784
mutex_lock(su_mutex); /* for navigating configfs hierarchy */
@@ -811,8 +803,6 @@ static int uvcg_streaming_header_drop_link(struct config_item *src,
811803
out:
812804
mutex_unlock(&opts->lock);
813805
mutex_unlock(su_mutex);
814-
return ret;
815-
816806
}
817807

818808
static struct configfs_item_operations uvcg_streaming_header_item_ops = {
@@ -2051,15 +2041,14 @@ static int uvcg_streaming_class_allow_link(struct config_item *src,
20512041
return ret;
20522042
}
20532043

2054-
static int uvcg_streaming_class_drop_link(struct config_item *src,
2044+
static void uvcg_streaming_class_drop_link(struct config_item *src,
20552045
struct config_item *target)
20562046
{
20572047
struct config_item *streaming, *header;
20582048
struct f_uvc_opts *opts;
20592049
struct mutex *su_mutex = &src->ci_group->cg_subsys->su_mutex;
20602050
struct uvc_descriptor_header ***class_array;
20612051
struct uvcg_streaming_header *target_hdr;
2062-
int ret = -EINVAL;
20632052

20642053
mutex_lock(su_mutex); /* for navigating configfs hierarchy */
20652054

@@ -2076,23 +2065,19 @@ static int uvcg_streaming_class_drop_link(struct config_item *src,
20762065
if (!class_array || !*class_array)
20772066
goto unlock;
20782067

2079-
if (opts->refcnt) {
2080-
ret = -EBUSY;
2068+
if (opts->refcnt)
20812069
goto unlock;
2082-
}
20832070

20842071
target_hdr = to_uvcg_streaming_header(target);
20852072
--target_hdr->linked;
20862073
kfree(**class_array);
20872074
kfree(*class_array);
20882075
*class_array = NULL;
2089-
ret = 0;
20902076

20912077
unlock:
20922078
mutex_unlock(&opts->lock);
20932079
out:
20942080
mutex_unlock(su_mutex);
2095-
return ret;
20962081
}
20972082

20982083
static struct configfs_item_operations uvcg_streaming_class_item_ops = {

include/linux/configfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static struct configfs_bin_attribute _pfx##attr_##_name = { \
228228
struct configfs_item_operations {
229229
void (*release)(struct config_item *);
230230
int (*allow_link)(struct config_item *src, struct config_item *target);
231-
int (*drop_link)(struct config_item *src, struct config_item *target);
231+
void (*drop_link)(struct config_item *src, struct config_item *target);
232232
};
233233

234234
struct configfs_group_operations {

0 commit comments

Comments
 (0)