提交 643de624 编写于 作者: M Michal Nazarewicz 提交者: Greg Kroah-Hartman

usb: core: Change usb_create_sysfs_intf_files()' return type to void

The usb_create_sysfs_intf_files() function always returned zero even
if it failed to create sysfs fails.  Since this is a desired behaviour
there is no need to return return code at all.  This commit changes
function's return type (form int) to void.
Signed-off-by: NMichal Nazarewicz <mina86@mina86.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 869410f8
...@@ -842,22 +842,19 @@ const struct attribute_group *usb_interface_groups[] = { ...@@ -842,22 +842,19 @@ const struct attribute_group *usb_interface_groups[] = {
NULL NULL
}; };
int usb_create_sysfs_intf_files(struct usb_interface *intf) void usb_create_sysfs_intf_files(struct usb_interface *intf)
{ {
struct usb_device *udev = interface_to_usbdev(intf); struct usb_device *udev = interface_to_usbdev(intf);
struct usb_host_interface *alt = intf->cur_altsetting; struct usb_host_interface *alt = intf->cur_altsetting;
int retval;
if (intf->sysfs_files_created || intf->unregistering) if (intf->sysfs_files_created || intf->unregistering)
return 0; return;
if (alt->string == NULL && if (!alt->string && !(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
!(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
alt->string = usb_cache_string(udev, alt->desc.iInterface); alt->string = usb_cache_string(udev, alt->desc.iInterface);
if (alt->string) if (alt->string && device_create_file(&intf->dev, &dev_attr_interface))
retval = device_create_file(&intf->dev, &dev_attr_interface); ; /* We don't actually care if the function fails. */
intf->sysfs_files_created = 1; intf->sysfs_files_created = 1;
return 0;
} }
void usb_remove_sysfs_intf_files(struct usb_interface *intf) void usb_remove_sysfs_intf_files(struct usb_interface *intf)
......
...@@ -953,8 +953,7 @@ static int usb_bus_notify(struct notifier_block *nb, unsigned long action, ...@@ -953,8 +953,7 @@ static int usb_bus_notify(struct notifier_block *nb, unsigned long action,
if (dev->type == &usb_device_type) if (dev->type == &usb_device_type)
(void) usb_create_sysfs_dev_files(to_usb_device(dev)); (void) usb_create_sysfs_dev_files(to_usb_device(dev));
else if (dev->type == &usb_if_device_type) else if (dev->type == &usb_if_device_type)
(void) usb_create_sysfs_intf_files( usb_create_sysfs_intf_files(to_usb_interface(dev));
to_usb_interface(dev));
break; break;
case BUS_NOTIFY_DEL_DEVICE: case BUS_NOTIFY_DEL_DEVICE:
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
extern int usb_create_sysfs_dev_files(struct usb_device *dev); extern int usb_create_sysfs_dev_files(struct usb_device *dev);
extern void usb_remove_sysfs_dev_files(struct usb_device *dev); extern void usb_remove_sysfs_dev_files(struct usb_device *dev);
extern int usb_create_sysfs_intf_files(struct usb_interface *intf); extern void usb_create_sysfs_intf_files(struct usb_interface *intf);
extern void usb_remove_sysfs_intf_files(struct usb_interface *intf); extern void usb_remove_sysfs_intf_files(struct usb_interface *intf);
extern int usb_create_ep_devs(struct device *parent, extern int usb_create_ep_devs(struct device *parent,
struct usb_host_endpoint *endpoint, struct usb_host_endpoint *endpoint,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册