vserver 1.9.5.x5
[linux-2.6.git] / drivers / usb / host / ehci-dbg.c
index bb8bf4c..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
@@ -185,7 +185,7 @@ dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd)
 }
 
 static int __attribute__((__unused__))
-dbg_status_buf (char *buf, unsigned len, char *label, u32 status)
+dbg_status_buf (char *buf, unsigned len, const char *label, u32 status)
 {
        return scnprintf (buf, len,
                "%s%sstatus %04x%s%s%s%s%s%s%s%s%s%s",
@@ -204,7 +204,7 @@ dbg_status_buf (char *buf, unsigned len, char *label, u32 status)
 }
 
 static int __attribute__((__unused__))
-dbg_intr_buf (char *buf, unsigned len, char *label, u32 enable)
+dbg_intr_buf (char *buf, unsigned len, const char *label, u32 enable)
 {
        return scnprintf (buf, len,
                "%s%sintrenable %02x%s%s%s%s%s%s",
@@ -221,7 +221,8 @@ dbg_intr_buf (char *buf, unsigned len, char *label, u32 enable)
 static const char *const fls_strings [] =
     { "1024", "512", "256", "??" };
 
-static int dbg_command_buf (char *buf, unsigned len, char *label, u32 command)
+static int
+dbg_command_buf (char *buf, unsigned len, const char *label, u32 command)
 {
        return scnprintf (buf, len,
                "%s%scommand %06x %s=%d ithresh=%d%s%s%s%s period=%s%s %s",
@@ -240,7 +241,7 @@ static int dbg_command_buf (char *buf, unsigned len, char *label, u32 command)
 }
 
 static int
-dbg_port_buf (char *buf, unsigned len, char *label, int port, u32 status)
+dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status)
 {
        char    *sig;
 
@@ -276,19 +277,19 @@ dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
 {}
 
 static inline int __attribute__((__unused__))
-dbg_status_buf (char *buf, unsigned len, char *label, u32 status)
+dbg_status_buf (char *buf, unsigned len, const char *label, u32 status)
 { return 0; }
 
 static inline int __attribute__((__unused__))
-dbg_command_buf (char *buf, unsigned len, char *label, u32 command)
+dbg_command_buf (char *buf, unsigned len, const char *label, u32 command)
 { return 0; }
 
 static inline int __attribute__((__unused__))
-dbg_intr_buf (char *buf, unsigned len, char *label, u32 enable)
+dbg_intr_buf (char *buf, unsigned len, const char *label, u32 enable)
 { return 0; }
 
 static inline int __attribute__((__unused__))
-dbg_port_buf (char *buf, unsigned len, char *label, int port, u32 status)
+dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status)
 { return 0; }
 
 #endif /* DEBUG */
@@ -656,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;
 
@@ -732,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 */