@@ -204,26 +204,7 @@ struct ati_remote2 {
204
204
unsigned int mode_mask ;
205
205
};
206
206
207
- static int ati_remote2_probe (struct usb_interface * interface , const struct usb_device_id * id );
208
- static void ati_remote2_disconnect (struct usb_interface * interface );
209
- static int ati_remote2_suspend (struct usb_interface * interface , pm_message_t message );
210
- static int ati_remote2_resume (struct usb_interface * interface );
211
- static int ati_remote2_reset_resume (struct usb_interface * interface );
212
- static int ati_remote2_pre_reset (struct usb_interface * interface );
213
- static int ati_remote2_post_reset (struct usb_interface * interface );
214
-
215
- static struct usb_driver ati_remote2_driver = {
216
- .name = "ati_remote2" ,
217
- .probe = ati_remote2_probe ,
218
- .disconnect = ati_remote2_disconnect ,
219
- .id_table = ati_remote2_id_table ,
220
- .suspend = ati_remote2_suspend ,
221
- .resume = ati_remote2_resume ,
222
- .reset_resume = ati_remote2_reset_resume ,
223
- .pre_reset = ati_remote2_pre_reset ,
224
- .post_reset = ati_remote2_post_reset ,
225
- .supports_autosuspend = 1 ,
226
- };
207
+ static struct usb_driver ati_remote2_driver ;
227
208
228
209
static int ati_remote2_submit_urbs (struct ati_remote2 * ar2 )
229
210
{
@@ -791,10 +772,7 @@ static struct attribute *ati_remote2_attrs[] = {
791
772
& dev_attr_mode_mask .attr ,
792
773
NULL ,
793
774
};
794
-
795
- static struct attribute_group ati_remote2_attr_group = {
796
- .attrs = ati_remote2_attrs ,
797
- };
775
+ ATTRIBUTE_GROUPS (ati_remote2 );
798
776
799
777
static int ati_remote2_probe (struct usb_interface * interface , const struct usb_device_id * id )
800
778
{
@@ -861,22 +839,16 @@ static int ati_remote2_probe(struct usb_interface *interface, const struct usb_d
861
839
862
840
strlcat (ar2 -> name , "ATI Remote Wonder II" , sizeof (ar2 -> name ));
863
841
864
- r = sysfs_create_group (& udev -> dev .kobj , & ati_remote2_attr_group );
865
- if (r )
866
- goto fail3 ;
867
-
868
842
r = ati_remote2_input_init (ar2 );
869
843
if (r )
870
- goto fail4 ;
844
+ goto fail3 ;
871
845
872
846
usb_set_intfdata (interface , ar2 );
873
847
874
848
interface -> needs_remote_wakeup = 1 ;
875
849
876
850
return 0 ;
877
851
878
- fail4 :
879
- sysfs_remove_group (& udev -> dev .kobj , & ati_remote2_attr_group );
880
852
fail3 :
881
853
ati_remote2_urb_cleanup (ar2 );
882
854
fail2 :
@@ -900,8 +872,6 @@ static void ati_remote2_disconnect(struct usb_interface *interface)
900
872
901
873
input_unregister_device (ar2 -> idev );
902
874
903
- sysfs_remove_group (& ar2 -> udev -> dev .kobj , & ati_remote2_attr_group );
904
-
905
875
ati_remote2_urb_cleanup (ar2 );
906
876
907
877
usb_driver_release_interface (& ati_remote2_driver , ar2 -> intf [1 ]);
@@ -1032,4 +1002,18 @@ static int ati_remote2_post_reset(struct usb_interface *interface)
1032
1002
return r ;
1033
1003
}
1034
1004
1005
+ static struct usb_driver ati_remote2_driver = {
1006
+ .name = "ati_remote2" ,
1007
+ .probe = ati_remote2_probe ,
1008
+ .disconnect = ati_remote2_disconnect ,
1009
+ .dev_groups = ati_remote2_groups ,
1010
+ .id_table = ati_remote2_id_table ,
1011
+ .suspend = ati_remote2_suspend ,
1012
+ .resume = ati_remote2_resume ,
1013
+ .reset_resume = ati_remote2_reset_resume ,
1014
+ .pre_reset = ati_remote2_pre_reset ,
1015
+ .post_reset = ati_remote2_post_reset ,
1016
+ .supports_autosuspend = 1 ,
1017
+ };
1018
+
1035
1019
module_usb_driver (ati_remote2_driver );
0 commit comments