da868ccbab05ddc7b147167a95a3ebaac9609e40
[openwrt.git] / target / linux / adm5120 / patches-2.6.25 / 901-usb_convert_from_class_device.patch
1 --- a/drivers/usb/host/adm5120-dbg.c
2 +++ b/drivers/usb/host/adm5120-dbg.c
3 @@ -456,7 +456,7 @@
4  }
5  
6  static ssize_t
7 -show_async(struct class_device *class_dev, char *buf)
8 +show_async(struct device *dev, struct device_attribute *attr, char *buf)
9  {
10         struct usb_bus          *bus;
11         struct usb_hcd          *hcd;
12 @@ -464,7 +464,7 @@
13         size_t                  temp;
14         unsigned long           flags;
15  
16 -       bus = class_get_devdata(class_dev);
17 +       bus = dev_get_drvdata(dev);
18         hcd = bus_to_hcd(bus);
19         ahcd = hcd_to_admhcd(hcd);
20  
21 @@ -475,13 +475,13 @@
22  
23         return temp;
24  }
25 -static CLASS_DEVICE_ATTR(async, S_IRUGO, show_async, NULL);
26 +static DEVICE_ATTR(async, S_IRUGO, show_async, NULL);
27  
28  
29  #define DBG_SCHED_LIMIT 64
30  
31  static ssize_t
32 -show_periodic(struct class_device *class_dev, char *buf)
33 +show_periodic(struct device *dev, struct device_attribute *attr, char *buf)
34  {
35         struct usb_bus          *bus;
36         struct usb_hcd          *hcd;
37 @@ -496,7 +496,7 @@
38                 return 0;
39         seen_count = 0;
40  
41 -       bus = class_get_devdata(class_dev);
42 +       bus = dev_get_drvdata(dev);
43         hcd = bus_to_hcd(bus);
44         ahcd = hcd_to_admhcd(hcd);
45         next = buf;
46 @@ -574,13 +574,13 @@
47  
48         return PAGE_SIZE - size;
49  }
50 -static CLASS_DEVICE_ATTR(periodic, S_IRUGO, show_periodic, NULL);
51 +static DEVICE_ATTR(periodic, S_IRUGO, show_periodic, NULL);
52  
53  
54  #undef DBG_SCHED_LIMIT
55  
56  static ssize_t
57 -show_registers(struct class_device *class_dev, char *buf)
58 +show_registers(struct device *dev, struct device_attribute *attr, char *buf)
59  {
60         struct usb_bus          *bus;
61         struct usb_hcd          *hcd;
62 @@ -591,7 +591,7 @@
63         char                    *next;
64         u32                     rdata;
65  
66 -       bus = class_get_devdata(class_dev);
67 +       bus = dev_get_drvdata(dev);
68         hcd = bus_to_hcd(bus);
69         ahcd = hcd_to_admhcd(hcd);
70         regs = ahcd->regs;
71 @@ -656,27 +656,27 @@
72         spin_unlock_irqrestore(&ahcd->lock, flags);
73         return PAGE_SIZE - size;
74  }
75 -static CLASS_DEVICE_ATTR(registers, S_IRUGO, show_registers, NULL);
76 +static DEVICE_ATTR(registers, S_IRUGO, show_registers, NULL);
77  
78  
79  static inline void create_debug_files (struct admhcd *ahcd)
80  {
81 -       struct class_device *cldev = admhcd_to_hcd(ahcd)->self.class_dev;
82 +       struct device *dev = admhcd_to_hcd(ahcd)->self.dev;
83         int retval;
84  
85 -       retval = class_device_create_file(cldev, &class_device_attr_async);
86 -       retval = class_device_create_file(cldev, &class_device_attr_periodic);
87 -       retval = class_device_create_file(cldev, &class_device_attr_registers);
88 +       retval = device_create_file(dev, &dev_attr_async);
89 +       retval = device_create_file(dev, &dev_attr_periodic);
90 +       retval = device_create_file(dev, &dev_attr_registers);
91         admhc_dbg(ahcd, "created debug files\n");
92  }
93  
94  static inline void remove_debug_files (struct admhcd *ahcd)
95  {
96 -       struct class_device *cldev = admhcd_to_hcd(ahcd)->self.class_dev;
97 +       struct device *dev = admhcd_to_hcd(ahcd)->self.dev;
98  
99 -       class_device_remove_file(cldev, &class_device_attr_async);
100 -       class_device_remove_file(cldev, &class_device_attr_periodic);
101 -       class_device_remove_file(cldev, &class_device_attr_registers);
102 +       device_remove_file(dev, &dev_attr_async);
103 +       device_remove_file(dev, &dev_attr_periodic);
104 +       device_remove_file(dev, &dev_attr_registers);
105  }
106  
107  #endif