diff options
Diffstat (limited to 'drivers/usb/core/endpoint.c')
-rw-r--r-- | drivers/usb/core/endpoint.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index 99e5a68a3f12..fae55a31e26d 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c | |||
@@ -156,6 +156,10 @@ static struct attribute *ep_dev_attrs[] = { | |||
156 | static struct attribute_group ep_dev_attr_grp = { | 156 | static struct attribute_group ep_dev_attr_grp = { |
157 | .attrs = ep_dev_attrs, | 157 | .attrs = ep_dev_attrs, |
158 | }; | 158 | }; |
159 | static struct attribute_group *ep_dev_groups[] = { | ||
160 | &ep_dev_attr_grp, | ||
161 | NULL | ||
162 | }; | ||
159 | 163 | ||
160 | static int usb_endpoint_major_init(void) | 164 | static int usb_endpoint_major_init(void) |
161 | { | 165 | { |
@@ -298,6 +302,7 @@ int usb_create_ep_files(struct device *parent, | |||
298 | 302 | ||
299 | ep_dev->desc = &endpoint->desc; | 303 | ep_dev->desc = &endpoint->desc; |
300 | ep_dev->udev = udev; | 304 | ep_dev->udev = udev; |
305 | ep_dev->dev.groups = ep_dev_groups; | ||
301 | ep_dev->dev.devt = MKDEV(usb_endpoint_major, ep_dev->minor); | 306 | ep_dev->dev.devt = MKDEV(usb_endpoint_major, ep_dev->minor); |
302 | ep_dev->dev.class = ep_class->class; | 307 | ep_dev->dev.class = ep_class->class; |
303 | ep_dev->dev.parent = parent; | 308 | ep_dev->dev.parent = parent; |
@@ -309,9 +314,6 @@ int usb_create_ep_files(struct device *parent, | |||
309 | retval = device_register(&ep_dev->dev); | 314 | retval = device_register(&ep_dev->dev); |
310 | if (retval) | 315 | if (retval) |
311 | goto error_chrdev; | 316 | goto error_chrdev; |
312 | retval = sysfs_create_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); | ||
313 | if (retval) | ||
314 | goto error_group; | ||
315 | 317 | ||
316 | /* create the symlink to the old-style "ep_XX" directory */ | 318 | /* create the symlink to the old-style "ep_XX" directory */ |
317 | sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); | 319 | sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); |
@@ -322,8 +324,6 @@ int usb_create_ep_files(struct device *parent, | |||
322 | return retval; | 324 | return retval; |
323 | 325 | ||
324 | error_link: | 326 | error_link: |
325 | sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); | ||
326 | error_group: | ||
327 | device_unregister(&ep_dev->dev); | 327 | device_unregister(&ep_dev->dev); |
328 | destroy_endpoint_class(); | 328 | destroy_endpoint_class(); |
329 | return retval; | 329 | return retval; |
@@ -348,7 +348,6 @@ void usb_remove_ep_files(struct usb_host_endpoint *endpoint) | |||
348 | 348 | ||
349 | sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); | 349 | sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); |
350 | sysfs_remove_link(&ep_dev->dev.parent->kobj, name); | 350 | sysfs_remove_link(&ep_dev->dev.parent->kobj, name); |
351 | sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); | ||
352 | device_unregister(&ep_dev->dev); | 351 | device_unregister(&ep_dev->dev); |
353 | endpoint->ep_dev = NULL; | 352 | endpoint->ep_dev = NULL; |
354 | destroy_endpoint_class(); | 353 | destroy_endpoint_class(); |