File tree Expand file tree Collapse file tree 4 files changed +22
-19
lines changed Expand file tree Collapse file tree 4 files changed +22
-19
lines changed Original file line number Diff line number Diff line change @@ -608,9 +608,11 @@ static struct hid_driver hammer_driver = {
608
608
.probe = hammer_probe ,
609
609
.remove = hammer_remove ,
610
610
.feature_mapping = vivaldi_feature_mapping ,
611
- .input_configured = vivaldi_input_configured ,
612
611
.input_mapping = hammer_input_mapping ,
613
612
.event = hammer_event ,
613
+ .driver = {
614
+ .dev_groups = vivaldi_attribute_groups ,
615
+ },
614
616
};
615
617
616
618
static int __init hammer_init (void )
Original file line number Diff line number Diff line change @@ -116,25 +116,26 @@ static struct attribute *vivaldi_sysfs_attrs[] = {
116
116
NULL
117
117
};
118
118
119
- static const struct attribute_group vivaldi_attribute_group = {
120
- .attrs = vivaldi_sysfs_attrs ,
121
- };
122
-
123
- /**
124
- * vivaldi_input_configured - Complete initialization of device using vivaldi map
125
- * @hdev: HID device to which vivaldi attributes should be attached
126
- * @hidinput: HID input device (unused)
127
- */
128
- int vivaldi_input_configured (struct hid_device * hdev ,
129
- struct hid_input * hidinput )
119
+ static umode_t vivaldi_is_visible (struct kobject * kobj , struct attribute * attr ,
120
+ int n )
130
121
{
122
+ struct hid_device * hdev = to_hid_device (kobj_to_dev (kobj ));
131
123
struct vivaldi_data * data = hid_get_drvdata (hdev );
132
124
133
125
if (!data -> num_function_row_keys )
134
126
return 0 ;
135
-
136
- return devm_device_add_group (& hdev -> dev , & vivaldi_attribute_group );
127
+ return attr -> mode ;
137
128
}
138
- EXPORT_SYMBOL_GPL (vivaldi_input_configured );
129
+
130
+ static const struct attribute_group vivaldi_attribute_group = {
131
+ .attrs = vivaldi_sysfs_attrs ,
132
+ .is_visible = vivaldi_is_visible ,
133
+ };
134
+
135
+ const struct attribute_group * vivaldi_attribute_groups [] = {
136
+ & vivaldi_attribute_group ,
137
+ NULL ,
138
+ };
139
+ EXPORT_SYMBOL_GPL (vivaldi_attribute_groups );
139
140
140
141
MODULE_LICENSE ("GPL" );
Original file line number Diff line number Diff line change 4
4
5
5
struct hid_device ;
6
6
struct hid_field ;
7
- struct hid_input ;
8
7
struct hid_usage ;
9
8
10
9
void vivaldi_feature_mapping (struct hid_device * hdev ,
11
10
struct hid_field * field , struct hid_usage * usage );
12
11
13
- int vivaldi_input_configured (struct hid_device * hdev ,
14
- struct hid_input * hidinput );
12
+ extern const struct attribute_group * vivaldi_attribute_groups [];
15
13
16
14
#endif /* _HID_VIVALDI_COMMON_H */
Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ static struct hid_driver hid_vivaldi = {
45
45
.id_table = vivaldi_table ,
46
46
.probe = vivaldi_probe ,
47
47
.feature_mapping = vivaldi_feature_mapping ,
48
- .input_configured = vivaldi_input_configured ,
48
+ .driver = {
49
+ .dev_groups = vivaldi_attribute_groups ,
50
+ },
49
51
};
50
52
51
53
module_hid_driver (hid_vivaldi );
You can’t perform that action at this time.
0 commit comments