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