diff options
author | Michal Nazarewicz <mina86@mina86.com> | 2011-04-14 11:47:09 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-29 20:24:38 -0400 |
commit | 643de6240b0b59c420ad71dfeeb3125a3607af92 (patch) | |
tree | a36dacc2a5c7eb9023c6d7d8a99d667e31551237 | |
parent | 869410f82cbbb1464772046d87de8d18a916e706 (diff) |
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: Michal Nazarewicz <mina86@mina86.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/core/sysfs.c | 13 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 3 | ||||
-rw-r--r-- | drivers/usb/core/usb.h | 2 |
3 files changed, 7 insertions, 11 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 6781c369ce2..cf05b97693e 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
@@ -842,22 +842,19 @@ const struct attribute_group *usb_interface_groups[] = { | |||
842 | NULL | 842 | NULL |
843 | }; | 843 | }; |
844 | 844 | ||
845 | int usb_create_sysfs_intf_files(struct usb_interface *intf) | 845 | void usb_create_sysfs_intf_files(struct usb_interface *intf) |
846 | { | 846 | { |
847 | struct usb_device *udev = interface_to_usbdev(intf); | 847 | struct usb_device *udev = interface_to_usbdev(intf); |
848 | struct usb_host_interface *alt = intf->cur_altsetting; | 848 | struct usb_host_interface *alt = intf->cur_altsetting; |
849 | int retval; | ||
850 | 849 | ||
851 | if (intf->sysfs_files_created || intf->unregistering) | 850 | if (intf->sysfs_files_created || intf->unregistering) |
852 | return 0; | 851 | return; |
853 | 852 | ||
854 | if (alt->string == NULL && | 853 | if (!alt->string && !(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) |
855 | !(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) | ||
856 | alt->string = usb_cache_string(udev, alt->desc.iInterface); | 854 | alt->string = usb_cache_string(udev, alt->desc.iInterface); |
857 | if (alt->string) | 855 | if (alt->string && device_create_file(&intf->dev, &dev_attr_interface)) |
858 | retval = device_create_file(&intf->dev, &dev_attr_interface); | 856 | ; /* We don't actually care if the function fails. */ |
859 | intf->sysfs_files_created = 1; | 857 | intf->sysfs_files_created = 1; |
860 | return 0; | ||
861 | } | 858 | } |
862 | 859 | ||
863 | void usb_remove_sysfs_intf_files(struct usb_interface *intf) | 860 | void usb_remove_sysfs_intf_files(struct usb_interface *intf) |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index d9d4b169404..8706fc97e60 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -953,8 +953,7 @@ static int usb_bus_notify(struct notifier_block *nb, unsigned long action, | |||
953 | if (dev->type == &usb_device_type) | 953 | if (dev->type == &usb_device_type) |
954 | (void) usb_create_sysfs_dev_files(to_usb_device(dev)); | 954 | (void) usb_create_sysfs_dev_files(to_usb_device(dev)); |
955 | else if (dev->type == &usb_if_device_type) | 955 | else if (dev->type == &usb_if_device_type) |
956 | (void) usb_create_sysfs_intf_files( | 956 | usb_create_sysfs_intf_files(to_usb_interface(dev)); |
957 | to_usb_interface(dev)); | ||
958 | break; | 957 | break; |
959 | 958 | ||
960 | case BUS_NOTIFY_DEL_DEVICE: | 959 | case BUS_NOTIFY_DEL_DEVICE: |
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index d450b742137..d44d4b7bbf1 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | extern int usb_create_sysfs_dev_files(struct usb_device *dev); | 5 | extern int usb_create_sysfs_dev_files(struct usb_device *dev); |
6 | extern void usb_remove_sysfs_dev_files(struct usb_device *dev); | 6 | extern void usb_remove_sysfs_dev_files(struct usb_device *dev); |
7 | extern int usb_create_sysfs_intf_files(struct usb_interface *intf); | 7 | extern void usb_create_sysfs_intf_files(struct usb_interface *intf); |
8 | extern void usb_remove_sysfs_intf_files(struct usb_interface *intf); | 8 | extern void usb_remove_sysfs_intf_files(struct usb_interface *intf); |
9 | extern int usb_create_ep_devs(struct device *parent, | 9 | extern int usb_create_ep_devs(struct device *parent, |
10 | struct usb_host_endpoint *endpoint, | 10 | struct usb_host_endpoint *endpoint, |