diff options
author | Christoph Hellwig <hch@lst.de> | 2016-02-26 11:02:14 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2016-03-06 16:11:24 +0100 |
commit | 1ae1602de028acaa42a0f6ff18d19756f8e825c6 (patch) | |
tree | 3370e5c29945370f62b9c72adeec587ed102d048 /drivers/usb/gadget/function/f_mass_storage.c | |
parent | b1f1a29d8fb5eeaeec2cafe4c62f276d950c015b (diff) | |
download | op-kernel-dev-1ae1602de028acaa42a0f6ff18d19756f8e825c6.zip op-kernel-dev-1ae1602de028acaa42a0f6ff18d19756f8e825c6.tar.gz |
configfs: switch ->default groups to a linked list
Replace the current NULL-terminated array of default groups with a linked
list. This gets rid of lots of nasty code to size and/or dynamically
allocate the array.
While we're at it also provide a conveniant helper to remove the default
groups.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Felipe Balbi <balbi@kernel.org> [drivers/usb/gadget]
Acked-by: Joel Becker <jlbec@evilplan.org>
Acked-by: Nicholas Bellinger <nab@linux-iscsi.org>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Diffstat (limited to 'drivers/usb/gadget/function/f_mass_storage.c')
-rw-r--r-- | drivers/usb/gadget/function/f_mass_storage.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 223ccf8..142bb77 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -3484,12 +3484,12 @@ static struct usb_function_instance *fsg_alloc_inst(void) opts->lun0.lun = opts->common->luns[0]; opts->lun0.lun_id = 0; - config_group_init_type_name(&opts->lun0.group, "lun.0", &fsg_lun_type); - opts->default_groups[0] = &opts->lun0.group; - opts->func_inst.group.default_groups = opts->default_groups; config_group_init_type_name(&opts->func_inst.group, "", &fsg_func_type); + config_group_init_type_name(&opts->lun0.group, "lun.0", &fsg_lun_type); + configfs_add_default_group(&opts->lun0.group, &opts->func_inst.group); + return &opts->func_inst; release_buffers: |