1 --- a/drivers/usb/host/adm5120-dbg.c
2 +++ b/drivers/usb/host/adm5120-dbg.c
7 -show_async(struct class_device *class_dev, char *buf)
8 +show_async(struct device *dev, struct device_attribute *attr, char *buf)
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);
25 -static CLASS_DEVICE_ATTR(async, S_IRUGO, show_async, NULL);
26 +static DEVICE_ATTR(async, S_IRUGO, show_async, NULL);
29 #define DBG_SCHED_LIMIT 64
32 -show_periodic(struct class_device *class_dev, char *buf)
33 +show_periodic(struct device *dev, struct device_attribute *attr, char *buf)
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);
48 return PAGE_SIZE - size;
50 -static CLASS_DEVICE_ATTR(periodic, S_IRUGO, show_periodic, NULL);
51 +static DEVICE_ATTR(periodic, S_IRUGO, show_periodic, NULL);
54 #undef DBG_SCHED_LIMIT
57 -show_registers(struct class_device *class_dev, char *buf)
58 +show_registers(struct device *dev, struct device_attribute *attr, char *buf)
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);
72 spin_unlock_irqrestore(&ahcd->lock, flags);
73 return PAGE_SIZE - size;
75 -static CLASS_DEVICE_ATTR(registers, S_IRUGO, show_registers, NULL);
76 +static DEVICE_ATTR(registers, S_IRUGO, show_registers, NULL);
79 static inline void create_debug_files (struct admhcd *ahcd)
81 - struct class_device *cldev = admhcd_to_hcd(ahcd)->self.class_dev;
82 + struct device *dev = admhcd_to_hcd(ahcd)->self.dev;
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");
94 static inline void remove_debug_files (struct admhcd *ahcd)
96 - struct class_device *cldev = admhcd_to_hcd(ahcd)->self.class_dev;
97 + struct device *dev = admhcd_to_hcd(ahcd)->self.dev;
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);