Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: straighten out inline code in sysfs.c

This patch (as1156) straightens out some code in usbcore. The
usb_create_intf_ep_files() and usb_remove_intf_ep_files() routines
don't need to be separate inlines; they should be moved bodily into
the places where they get used.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


authored by

Alan Stern and committed by
Greg Kroah-Hartman
92b0da15 da2bbdcc

+9 -26
+9 -26
drivers/usb/core/sysfs.c
··· 812 812 NULL 813 813 }; 814 814 815 - static inline void usb_create_intf_ep_files(struct usb_interface *intf, 816 - struct usb_device *udev) 817 - { 818 - struct usb_host_interface *iface_desc; 819 - int i; 820 - 821 - iface_desc = intf->cur_altsetting; 822 - for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) 823 - usb_create_ep_files(&intf->dev, &iface_desc->endpoint[i], 824 - udev); 825 - } 826 - 827 - static inline void usb_remove_intf_ep_files(struct usb_interface *intf) 828 - { 829 - struct usb_host_interface *iface_desc; 830 - int i; 831 - 832 - iface_desc = intf->cur_altsetting; 833 - for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) 834 - usb_remove_ep_files(&iface_desc->endpoint[i]); 835 - } 836 - 837 815 int usb_create_sysfs_intf_files(struct usb_interface *intf) 838 816 { 839 817 struct usb_device *udev = interface_to_usbdev(intf); 840 818 struct usb_host_interface *alt = intf->cur_altsetting; 819 + int i; 841 820 int retval; 842 821 843 822 if (intf->sysfs_files_created || intf->unregistering) ··· 830 851 alt->string = usb_cache_string(udev, alt->desc.iInterface); 831 852 if (alt->string) 832 853 retval = device_create_file(&intf->dev, &dev_attr_interface); 833 - usb_create_intf_ep_files(intf, udev); 854 + for (i = 0; i < alt->desc.bNumEndpoints; ++i) 855 + usb_create_ep_files(&intf->dev, &alt->endpoint[i], udev); 834 856 intf->sysfs_files_created = 1; 835 857 return 0; 836 858 } 837 859 838 860 void usb_remove_sysfs_intf_files(struct usb_interface *intf) 839 861 { 840 - struct device *dev = &intf->dev; 862 + struct usb_host_interface *alt = intf->cur_altsetting; 863 + int i; 841 864 842 865 if (!intf->sysfs_files_created) 843 866 return; 844 - usb_remove_intf_ep_files(intf); 845 - device_remove_file(dev, &dev_attr_interface); 867 + 868 + for (i = 0; i < alt->desc.bNumEndpoints; ++i) 869 + usb_remove_ep_files(&alt->endpoint[i]); 870 + device_remove_file(&intf->dev, &dev_attr_interface); 846 871 intf->sysfs_files_created = 0; 847 872 }