diff options
Diffstat (limited to 'drivers/usb/gadget/function/f_acm.c')
-rw-r--r-- | drivers/usb/gadget/function/f_acm.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c index 22e723d12d36..2fa1e80a3ce7 100644 --- a/drivers/usb/gadget/function/f_acm.c +++ b/drivers/usb/gadget/function/f_acm.c | |||
@@ -761,21 +761,6 @@ static inline struct f_serial_opts *to_f_serial_opts(struct config_item *item) | |||
761 | func_inst.group); | 761 | func_inst.group); |
762 | } | 762 | } |
763 | 763 | ||
764 | CONFIGFS_ATTR_STRUCT(f_serial_opts); | ||
765 | static ssize_t f_acm_attr_show(struct config_item *item, | ||
766 | struct configfs_attribute *attr, | ||
767 | char *page) | ||
768 | { | ||
769 | struct f_serial_opts *opts = to_f_serial_opts(item); | ||
770 | struct f_serial_opts_attribute *f_serial_opts_attr = | ||
771 | container_of(attr, struct f_serial_opts_attribute, attr); | ||
772 | ssize_t ret = 0; | ||
773 | |||
774 | if (f_serial_opts_attr->show) | ||
775 | ret = f_serial_opts_attr->show(opts, page); | ||
776 | return ret; | ||
777 | } | ||
778 | |||
779 | static void acm_attr_release(struct config_item *item) | 764 | static void acm_attr_release(struct config_item *item) |
780 | { | 765 | { |
781 | struct f_serial_opts *opts = to_f_serial_opts(item); | 766 | struct f_serial_opts *opts = to_f_serial_opts(item); |
@@ -785,20 +770,17 @@ static void acm_attr_release(struct config_item *item) | |||
785 | 770 | ||
786 | static struct configfs_item_operations acm_item_ops = { | 771 | static struct configfs_item_operations acm_item_ops = { |
787 | .release = acm_attr_release, | 772 | .release = acm_attr_release, |
788 | .show_attribute = f_acm_attr_show, | ||
789 | }; | 773 | }; |
790 | 774 | ||
791 | static ssize_t f_acm_port_num_show(struct f_serial_opts *opts, char *page) | 775 | static ssize_t f_acm_port_num_show(struct config_item *item, char *page) |
792 | { | 776 | { |
793 | return sprintf(page, "%u\n", opts->port_num); | 777 | return sprintf(page, "%u\n", to_f_serial_opts(item)->port_num); |
794 | } | 778 | } |
795 | 779 | ||
796 | static struct f_serial_opts_attribute f_acm_port_num = | 780 | CONFIGFS_ATTR_RO(f_acm_port_, num); |
797 | __CONFIGFS_ATTR_RO(port_num, f_acm_port_num_show); | ||
798 | |||
799 | 781 | ||
800 | static struct configfs_attribute *acm_attrs[] = { | 782 | static struct configfs_attribute *acm_attrs[] = { |
801 | &f_acm_port_num.attr, | 783 | &f_acm_port_attr_num, |
802 | NULL, | 784 | NULL, |
803 | }; | 785 | }; |
804 | 786 | ||