aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2009-04-27 15:22:12 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-04-27 15:22:12 -0700
commit688ca9b5ebe1e17de831df4f4a39ec82041a59e5 (patch)
tree0997780432a7fc26dc5fb2a750be509bb137b5df /usb
parentfb8c969114a736513bdd927d63625a787dc089e4 (diff)
downloadpatches-688ca9b5ebe1e17de831df4f4a39ec82041a59e5.tar.gz
more patches
Diffstat (limited to 'usb')
-rw-r--r--usb/usb-ehci-create-sysfs-companion-files-directly-in-the-controller-device.patch37
-rw-r--r--usb/usb-ohci-use-the-ohci-structure-directly-in-debugfs-files.patch135
-rw-r--r--usb/usb-remove-unused-usb_host-class.patch126
3 files changed, 298 insertions, 0 deletions
diff --git a/usb/usb-ehci-create-sysfs-companion-files-directly-in-the-controller-device.patch b/usb/usb-ehci-create-sysfs-companion-files-directly-in-the-controller-device.patch
new file mode 100644
index 00000000000000..e7ec8e811534ba
--- /dev/null
+++ b/usb/usb-ehci-create-sysfs-companion-files-directly-in-the-controller-device.patch
@@ -0,0 +1,37 @@
+From foo@baz Mon Apr 27 13:15:38 PDT 2009
+Date: Mon, 27 Apr 2009 13:15:38 -0700
+To: Greg KH <greg@kroah.com>
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Subject: USB: EHCI: create sysfs companion files directly in the controller device
+
+The controller device is where we want this sysfs file, especially as
+the dev pointer is about to go away...
+
+Cc: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+---
+ drivers/usb/host/ehci-hub.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/host/ehci-hub.c
++++ b/drivers/usb/host/ehci-hub.c
+@@ -391,7 +391,7 @@ static inline void create_companion_file
+
+ /* with integrated TT there is no companion! */
+ if (!ehci_is_TDI(ehci))
+- i = device_create_file(ehci_to_hcd(ehci)->self.dev,
++ i = device_create_file(ehci_to_hcd(ehci)->self.controller,
+ &dev_attr_companion);
+ }
+
+@@ -399,7 +399,7 @@ static inline void remove_companion_file
+ {
+ /* with integrated TT there is no companion! */
+ if (!ehci_is_TDI(ehci))
+- device_remove_file(ehci_to_hcd(ehci)->self.dev,
++ device_remove_file(ehci_to_hcd(ehci)->self.controller,
+ &dev_attr_companion);
+ }
+
diff --git a/usb/usb-ohci-use-the-ohci-structure-directly-in-debugfs-files.patch b/usb/usb-ohci-use-the-ohci-structure-directly-in-debugfs-files.patch
new file mode 100644
index 00000000000000..1363d9b3903392
--- /dev/null
+++ b/usb/usb-ohci-use-the-ohci-structure-directly-in-debugfs-files.patch
@@ -0,0 +1,135 @@
+From foo@baz Mon Apr 27 13:12:58 PDT 2009
+Date: Mon, 27 Apr 2009 13:12:58 -0700
+To: Greg KH <greg@kroah.com>
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Subject: USB: OHCI: use the ohci structure directly in debugfs files.
+
+Right now we jump through some hoops to get to the struct ohci_hcd
+struct in the ohci debugfs files. Remove all of the fun casting around
+and just use the pointer directly.
+
+This is needed as the dev pointer in the hcd structure is going away,
+and it makes the code simpler and smaller
+
+Cc: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/usb/host/ohci-dbg.c | 31 ++++++++++---------------------
+ 1 file changed, 10 insertions(+), 21 deletions(-)
+
+--- a/drivers/usb/host/ohci-dbg.c
++++ b/drivers/usb/host/ohci-dbg.c
+@@ -431,7 +431,7 @@ static struct dentry *ohci_debug_root;
+
+ struct debug_buffer {
+ ssize_t (*fill_func)(struct debug_buffer *); /* fill method */
+- struct device *dev;
++ struct ohci_hcd *ohci;
+ struct mutex mutex; /* protect filling of buffer */
+ size_t count; /* number of characters filled into buffer */
+ char *page;
+@@ -505,15 +505,11 @@ show_list (struct ohci_hcd *ohci, char *
+
+ static ssize_t fill_async_buffer(struct debug_buffer *buf)
+ {
+- struct usb_bus *bus;
+- struct usb_hcd *hcd;
+ struct ohci_hcd *ohci;
+ size_t temp;
+ unsigned long flags;
+
+- bus = dev_get_drvdata(buf->dev);
+- hcd = bus_to_hcd(bus);
+- ohci = hcd_to_ohci(hcd);
++ ohci = buf->ohci;
+
+ /* display control and bulk lists together, for simplicity */
+ spin_lock_irqsave (&ohci->lock, flags);
+@@ -529,8 +525,6 @@ static ssize_t fill_async_buffer(struct
+
+ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
+ {
+- struct usb_bus *bus;
+- struct usb_hcd *hcd;
+ struct ohci_hcd *ohci;
+ struct ed **seen, *ed;
+ unsigned long flags;
+@@ -542,9 +536,7 @@ static ssize_t fill_periodic_buffer(stru
+ return 0;
+ seen_count = 0;
+
+- bus = (struct usb_bus *)dev_get_drvdata(buf->dev);
+- hcd = bus_to_hcd(bus);
+- ohci = hcd_to_ohci(hcd);
++ ohci = buf->ohci;
+ next = buf->page;
+ size = PAGE_SIZE;
+
+@@ -626,7 +618,6 @@ static ssize_t fill_periodic_buffer(stru
+
+ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
+ {
+- struct usb_bus *bus;
+ struct usb_hcd *hcd;
+ struct ohci_hcd *ohci;
+ struct ohci_regs __iomem *regs;
+@@ -635,9 +626,8 @@ static ssize_t fill_registers_buffer(str
+ char *next;
+ u32 rdata;
+
+- bus = (struct usb_bus *)dev_get_drvdata(buf->dev);
+- hcd = bus_to_hcd(bus);
+- ohci = hcd_to_ohci(hcd);
++ ohci = buf->ohci;
++ hcd = ohci_to_hcd(ohci);
+ regs = ohci->regs;
+ next = buf->page;
+ size = PAGE_SIZE;
+@@ -710,7 +700,7 @@ done:
+ return PAGE_SIZE - size;
+ }
+
+-static struct debug_buffer *alloc_buffer(struct device *dev,
++static struct debug_buffer *alloc_buffer(struct ohci_hcd *ohci,
+ ssize_t (*fill_func)(struct debug_buffer *))
+ {
+ struct debug_buffer *buf;
+@@ -718,7 +708,7 @@ static struct debug_buffer *alloc_buffer
+ buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL);
+
+ if (buf) {
+- buf->dev = dev;
++ buf->ohci = ohci;
+ buf->fill_func = fill_func;
+ mutex_init(&buf->mutex);
+ }
+@@ -810,26 +800,25 @@ static int debug_registers_open(struct i
+ static inline void create_debug_files (struct ohci_hcd *ohci)
+ {
+ struct usb_bus *bus = &ohci_to_hcd(ohci)->self;
+- struct device *dev = bus->dev;
+
+ ohci->debug_dir = debugfs_create_dir(bus->bus_name, ohci_debug_root);
+ if (!ohci->debug_dir)
+ goto dir_error;
+
+ ohci->debug_async = debugfs_create_file("async", S_IRUGO,
+- ohci->debug_dir, dev,
++ ohci->debug_dir, ohci,
+ &debug_async_fops);
+ if (!ohci->debug_async)
+ goto async_error;
+
+ ohci->debug_periodic = debugfs_create_file("periodic", S_IRUGO,
+- ohci->debug_dir, dev,
++ ohci->debug_dir, ohci,
+ &debug_periodic_fops);
+ if (!ohci->debug_periodic)
+ goto periodic_error;
+
+ ohci->debug_registers = debugfs_create_file("registers", S_IRUGO,
+- ohci->debug_dir, dev,
++ ohci->debug_dir, ohci,
+ &debug_registers_fops);
+ if (!ohci->debug_registers)
+ goto registers_error;
diff --git a/usb/usb-remove-unused-usb_host-class.patch b/usb/usb-remove-unused-usb_host-class.patch
new file mode 100644
index 00000000000000..7f5117ed5afb21
--- /dev/null
+++ b/usb/usb-remove-unused-usb_host-class.patch
@@ -0,0 +1,126 @@
+From foo@baz Mon Apr 27 13:17:21 PDT 2009
+Date: Mon, 27 Apr 2009 13:17:21 -0700
+To: Greg KH <greg@kroah.com>
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Subject: USB: remove unused usb_host class
+
+The usb_host class isn't used for anything anymore (it was used for
+debug files, but they have moved to debugfs a few kernel releases ago),
+so let's delete it before someone accidentally puts a file in it.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/hcd.c | 27 ---------------------------
+ drivers/usb/core/usb.c | 6 ------
+ drivers/usb/core/usb.h | 2 --
+ include/linux/usb.h | 1 -
+ 4 files changed, 36 deletions(-)
+
+--- a/drivers/usb/core/hcd.c
++++ b/drivers/usb/core/hcd.c
+@@ -755,23 +755,6 @@ static struct attribute_group usb_bus_at
+
+ /*-------------------------------------------------------------------------*/
+
+-static struct class *usb_host_class;
+-
+-int usb_host_init(void)
+-{
+- int retval = 0;
+-
+- usb_host_class = class_create(THIS_MODULE, "usb_host");
+- if (IS_ERR(usb_host_class))
+- retval = PTR_ERR(usb_host_class);
+- return retval;
+-}
+-
+-void usb_host_cleanup(void)
+-{
+- class_destroy(usb_host_class);
+-}
+-
+ /**
+ * usb_bus_init - shared initialization code
+ * @bus: the bus structure being initialized
+@@ -818,12 +801,6 @@ static int usb_register_bus(struct usb_b
+ set_bit (busnum, busmap.busmap);
+ bus->busnum = busnum;
+
+- bus->dev = device_create(usb_host_class, bus->controller, MKDEV(0, 0),
+- bus, "usb_host%d", busnum);
+- result = PTR_ERR(bus->dev);
+- if (IS_ERR(bus->dev))
+- goto error_create_class_dev;
+-
+ /* Add it to the local list of buses */
+ list_add (&bus->bus_list, &usb_bus_list);
+ mutex_unlock(&usb_bus_list_lock);
+@@ -834,8 +811,6 @@ static int usb_register_bus(struct usb_b
+ "number %d\n", bus->busnum);
+ return 0;
+
+-error_create_class_dev:
+- clear_bit(busnum, busmap.busmap);
+ error_find_busnum:
+ mutex_unlock(&usb_bus_list_lock);
+ return result;
+@@ -865,8 +840,6 @@ static void usb_deregister_bus (struct u
+ usb_notify_remove_bus(bus);
+
+ clear_bit (bus->busnum, busmap.busmap);
+-
+- device_unregister(bus->dev);
+ }
+
+ /**
+--- a/drivers/usb/core/usb.c
++++ b/drivers/usb/core/usb.c
+@@ -1055,9 +1055,6 @@ static int __init usb_init(void)
+ retval = bus_register_notifier(&usb_bus_type, &usb_bus_nb);
+ if (retval)
+ goto bus_notifier_failed;
+- retval = usb_host_init();
+- if (retval)
+- goto host_init_failed;
+ retval = usb_major_init();
+ if (retval)
+ goto major_init_failed;
+@@ -1087,8 +1084,6 @@ usb_devio_init_failed:
+ driver_register_failed:
+ usb_major_cleanup();
+ major_init_failed:
+- usb_host_cleanup();
+-host_init_failed:
+ bus_unregister_notifier(&usb_bus_type, &usb_bus_nb);
+ bus_notifier_failed:
+ bus_unregister(&usb_bus_type);
+@@ -1113,7 +1108,6 @@ static void __exit usb_exit(void)
+ usb_deregister(&usbfs_driver);
+ usb_devio_cleanup();
+ usb_hub_cleanup();
+- usb_host_cleanup();
+ bus_unregister_notifier(&usb_bus_type, &usb_bus_nb);
+ bus_unregister(&usb_bus_type);
+ ksuspend_usb_cleanup();
+--- a/drivers/usb/core/usb.h
++++ b/drivers/usb/core/usb.h
+@@ -41,8 +41,6 @@ extern int usb_hub_init(void);
+ extern void usb_hub_cleanup(void);
+ extern int usb_major_init(void);
+ extern void usb_major_cleanup(void);
+-extern int usb_host_init(void);
+-extern void usb_host_cleanup(void);
+
+ #ifdef CONFIG_PM
+
+--- a/include/linux/usb.h
++++ b/include/linux/usb.h
+@@ -336,7 +336,6 @@ struct usb_bus {
+ #ifdef CONFIG_USB_DEVICEFS
+ struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */
+ #endif
+- struct device *dev; /* device for this bus */
+
+ #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
+ struct mon_bus *mon_bus; /* non-null when associated */