- patches.fixes/patch-2.6.11-rc1: 2.6.11-rc1.
[linux-flexiantxendom0-3.2.10.git] / drivers / usb / host / ehci-dbg.c
index b83e753..495e2a3 100644 (file)
 /* this file is part of ehci-hcd.c */
 
 #define ehci_dbg(ehci, fmt, args...) \
-       dev_dbg ((ehci)->hcd.self.controller , fmt , ## args )
+       dev_dbg (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
 #define ehci_err(ehci, fmt, args...) \
-       dev_err ((ehci)->hcd.self.controller , fmt , ## args )
+       dev_err (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
 #define ehci_info(ehci, fmt, args...) \
-       dev_info ((ehci)->hcd.self.controller , fmt , ## args )
+       dev_info (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
 #define ehci_warn(ehci, fmt, args...) \
-       dev_warn ((ehci)->hcd.self.controller , fmt , ## args )
+       dev_warn (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
 
 #ifdef EHCI_VERBOSE_DEBUG
 #      define vdbg dbg
@@ -657,7 +657,7 @@ show_registers (struct class_device *class_dev, char *buf)
                "EHCI %x.%02x, hcd state %d\n",
                hcd->self.controller->bus->name,
                hcd->self.controller->bus_id,
-               i >> 8, i & 0x0ff, ehci->hcd.state);
+               i >> 8, i & 0x0ff, hcd->state);
        size -= temp;
        next += temp;
 
@@ -733,18 +733,22 @@ done:
 }
 static CLASS_DEVICE_ATTR (registers, S_IRUGO, show_registers, NULL);
 
-static inline void create_debug_files (struct ehci_hcd *bus)
+static inline void create_debug_files (struct ehci_hcd *ehci)
 {
-       class_device_create_file(&bus->hcd.self.class_dev, &class_device_attr_async);
-       class_device_create_file(&bus->hcd.self.class_dev, &class_device_attr_periodic);
-       class_device_create_file(&bus->hcd.self.class_dev, &class_device_attr_registers);
+       struct class_device *cldev = &ehci_to_hcd(ehci)->self.class_dev;
+
+       class_device_create_file(cldev, &class_device_attr_async);
+       class_device_create_file(cldev, &class_device_attr_periodic);
+       class_device_create_file(cldev, &class_device_attr_registers);
 }
 
-static inline void remove_debug_files (struct ehci_hcd *bus)
+static inline void remove_debug_files (struct ehci_hcd *ehci)
 {
-       class_device_remove_file(&bus->hcd.self.class_dev, &class_device_attr_async);
-       class_device_remove_file(&bus->hcd.self.class_dev, &class_device_attr_periodic);
-       class_device_remove_file(&bus->hcd.self.class_dev, &class_device_attr_registers);
+       struct class_device *cldev = &ehci_to_hcd(ehci)->self.class_dev;
+
+       class_device_remove_file(cldev, &class_device_attr_async);
+       class_device_remove_file(cldev, &class_device_attr_periodic);
+       class_device_remove_file(cldev, &class_device_attr_registers);
 }
 
 #endif /* STUB_DEBUG_FILES */