@@ -713,9 +713,6 @@ static inline struct f_hid_opts *to_f_hid_opts(struct config_item *item)
713
713
func_inst .group );
714
714
}
715
715
716
- CONFIGFS_ATTR_STRUCT (f_hid_opts );
717
- CONFIGFS_ATTR_OPS (f_hid_opts );
718
-
719
716
static void hid_attr_release (struct config_item * item )
720
717
{
721
718
struct f_hid_opts * opts = to_f_hid_opts (item );
@@ -725,13 +722,12 @@ static void hid_attr_release(struct config_item *item)
725
722
726
723
static struct configfs_item_operations hidg_item_ops = {
727
724
.release = hid_attr_release ,
728
- .show_attribute = f_hid_opts_attr_show ,
729
- .store_attribute = f_hid_opts_attr_store ,
730
725
};
731
726
732
727
#define F_HID_OPT (name , prec , limit ) \
733
- static ssize_t f_hid_opts_##name##_show(struct f_hid_opts *opts , char *page)\
728
+ static ssize_t f_hid_opts_##name##_show(struct config_item *item , char *page)\
734
729
{ \
730
+ struct f_hid_opts *opts = to_f_hid_opts(item); \
735
731
int result; \
736
732
\
737
733
mutex_lock(&opts->lock); \
@@ -741,9 +737,10 @@ static ssize_t f_hid_opts_##name##_show(struct f_hid_opts *opts, char *page)\
741
737
return result; \
742
738
} \
743
739
\
744
- static ssize_t f_hid_opts_##name##_store(struct f_hid_opts *opts , \
740
+ static ssize_t f_hid_opts_##name##_store(struct config_item *item , \
745
741
const char *page, size_t len) \
746
742
{ \
743
+ struct f_hid_opts *opts = to_f_hid_opts(item); \
747
744
int ret; \
748
745
u##prec num; \
749
746
\
@@ -769,16 +766,15 @@ end: \
769
766
return ret; \
770
767
} \
771
768
\
772
- static struct f_hid_opts_attribute f_hid_opts_##name = \
773
- __CONFIGFS_ATTR(name, S_IRUGO | S_IWUSR, f_hid_opts_##name##_show,\
774
- f_hid_opts_##name##_store)
769
+ CONFIGFS_ATTR(f_hid_opts_, name)
775
770
776
771
F_HID_OPT (subclass , 8 , 255 );
777
772
F_HID_OPT (protocol , 8 , 255 );
778
773
F_HID_OPT (report_length , 16 , 65535 );
779
774
780
- static ssize_t f_hid_opts_report_desc_show (struct f_hid_opts * opts , char * page )
775
+ static ssize_t f_hid_opts_report_desc_show (struct config_item * item , char * page )
781
776
{
777
+ struct f_hid_opts * opts = to_f_hid_opts (item );
782
778
int result ;
783
779
784
780
mutex_lock (& opts -> lock );
@@ -789,9 +785,10 @@ static ssize_t f_hid_opts_report_desc_show(struct f_hid_opts *opts, char *page)
789
785
return result ;
790
786
}
791
787
792
- static ssize_t f_hid_opts_report_desc_store (struct f_hid_opts * opts ,
788
+ static ssize_t f_hid_opts_report_desc_store (struct config_item * item ,
793
789
const char * page , size_t len )
794
790
{
791
+ struct f_hid_opts * opts = to_f_hid_opts (item );
795
792
int ret = - EBUSY ;
796
793
char * d ;
797
794
@@ -818,16 +815,13 @@ static ssize_t f_hid_opts_report_desc_store(struct f_hid_opts *opts,
818
815
return ret ;
819
816
}
820
817
821
- static struct f_hid_opts_attribute f_hid_opts_report_desc =
822
- __CONFIGFS_ATTR (report_desc , S_IRUGO | S_IWUSR ,
823
- f_hid_opts_report_desc_show ,
824
- f_hid_opts_report_desc_store );
818
+ CONFIGFS_ATTR (f_hid_opts_ , report_desc );
825
819
826
820
static struct configfs_attribute * hid_attrs [] = {
827
- & f_hid_opts_subclass . attr ,
828
- & f_hid_opts_protocol . attr ,
829
- & f_hid_opts_report_length . attr ,
830
- & f_hid_opts_report_desc . attr ,
821
+ & f_hid_opts_attr_subclass ,
822
+ & f_hid_opts_attr_protocol ,
823
+ & f_hid_opts_attr_report_length ,
824
+ & f_hid_opts_attr_report_desc ,
831
825
NULL ,
832
826
};
833
827
0 commit comments