aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hub.c
diff options
context:
space:
mode:
authorTony Jones <tonyj@suse.de>2007-09-11 17:07:31 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-02-01 17:34:46 -0500
commit5a3201b2809a9f7bcda8413c445483f5b5e490a3 (patch)
tree3be21f9b9a8fa953645b889bbf31c3b8ec6f19a0 /drivers/usb/host/ehci-hub.c
parentde6f92b9ee00e9f841fb1a63d0bd60593ec55dbe (diff)
USB: Convert from class_device to device for USB core
Convert from class_device to device for drivers/usb/core. Signed-off-by: Tony Jones <tonyj@suse.de> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-hub.c')
-rw-r--r--drivers/usb/host/ehci-hub.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 735db4aec831..1ad7a6572826 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -291,14 +291,16 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
291/*-------------------------------------------------------------------------*/ 291/*-------------------------------------------------------------------------*/
292 292
293/* Display the ports dedicated to the companion controller */ 293/* Display the ports dedicated to the companion controller */
294static ssize_t show_companion(struct class_device *class_dev, char *buf) 294static ssize_t show_companion(struct device *dev,
295 struct device_attribute *attr,
296 char *buf)
295{ 297{
296 struct ehci_hcd *ehci; 298 struct ehci_hcd *ehci;
297 int nports, index, n; 299 int nports, index, n;
298 int count = PAGE_SIZE; 300 int count = PAGE_SIZE;
299 char *ptr = buf; 301 char *ptr = buf;
300 302
301 ehci = hcd_to_ehci(bus_to_hcd(class_get_devdata(class_dev))); 303 ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
302 nports = HCS_N_PORTS(ehci->hcs_params); 304 nports = HCS_N_PORTS(ehci->hcs_params);
303 305
304 for (index = 0; index < nports; ++index) { 306 for (index = 0; index < nports; ++index) {
@@ -316,15 +318,16 @@ static ssize_t show_companion(struct class_device *class_dev, char *buf)
316 * Syntax is "[-]portnum", where a leading '-' sign means 318 * Syntax is "[-]portnum", where a leading '-' sign means
317 * return control of the port to the EHCI controller. 319 * return control of the port to the EHCI controller.
318 */ 320 */
319static ssize_t store_companion(struct class_device *class_dev, 321static ssize_t store_companion(struct device *dev,
320 const char *buf, size_t count) 322 struct device_attribute *attr,
323 const char *buf, size_t count)
321{ 324{
322 struct ehci_hcd *ehci; 325 struct ehci_hcd *ehci;
323 int portnum, new_owner, try; 326 int portnum, new_owner, try;
324 u32 __iomem *status_reg; 327 u32 __iomem *status_reg;
325 u32 port_status; 328 u32 port_status;
326 329
327 ehci = hcd_to_ehci(bus_to_hcd(class_get_devdata(class_dev))); 330 ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
328 new_owner = PORT_OWNER; /* Owned by companion */ 331 new_owner = PORT_OWNER; /* Owned by companion */
329 if (sscanf(buf, "%d", &portnum) != 1) 332 if (sscanf(buf, "%d", &portnum) != 1)
330 return -EINVAL; 333 return -EINVAL;
@@ -364,7 +367,7 @@ static ssize_t store_companion(struct class_device *class_dev,
364 } 367 }
365 return count; 368 return count;
366} 369}
367static CLASS_DEVICE_ATTR(companion, 0644, show_companion, store_companion); 370static DEVICE_ATTR(companion, 0644, show_companion, store_companion);
368 371
369static inline void create_companion_file(struct ehci_hcd *ehci) 372static inline void create_companion_file(struct ehci_hcd *ehci)
370{ 373{
@@ -372,16 +375,16 @@ static inline void create_companion_file(struct ehci_hcd *ehci)
372 375
373 /* with integrated TT there is no companion! */ 376 /* with integrated TT there is no companion! */
374 if (!ehci_is_TDI(ehci)) 377 if (!ehci_is_TDI(ehci))
375 i = class_device_create_file(ehci_to_hcd(ehci)->self.class_dev, 378 i = device_create_file(ehci_to_hcd(ehci)->self.dev,
376 &class_device_attr_companion); 379 &dev_attr_companion);
377} 380}
378 381
379static inline void remove_companion_file(struct ehci_hcd *ehci) 382static inline void remove_companion_file(struct ehci_hcd *ehci)
380{ 383{
381 /* with integrated TT there is no companion! */ 384 /* with integrated TT there is no companion! */
382 if (!ehci_is_TDI(ehci)) 385 if (!ehci_is_TDI(ehci))
383 class_device_remove_file(ehci_to_hcd(ehci)->self.class_dev, 386 device_remove_file(ehci_to_hcd(ehci)->self.dev,
384 &class_device_attr_companion); 387 &dev_attr_companion);
385} 388}
386 389
387 390