Changeset 13508


Ignore:
Timestamp:
2008-12-04T10:42:26+01:00 (8 years ago)
Author:
juhosg
Message:

[ar71xx] OHCI driver cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/files/drivers/usb/host/ohci-ar71xx.c

    r11894 r13508  
    11/* 
    2  * OHCI HCD (Host Controller Driver) for USB. 
     2 *  OHCI HCD (Host Controller Driver) for USB. 
    33 * 
    4  * Copyright (C) 2007 Atheros Communications, Inc. 
    5  * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org> 
    6  * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> 
     4 *  Bus Glue for Atheros AR71xx built-in OHCI controller. 
    75 * 
    8  * Bus Glue for Atheros AR71xx built-in OHCI controller 
     6 *  Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org> 
     7 *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> 
    98 * 
     9 *  Parts of this file are based on Atheros' 2.6.15 BSP 
     10 *      Copyright (C) 2007 Atheros Communications, Inc. 
     11 * 
     12 *  This program is free software; you can redistribute it and/or modify it 
     13 *  under the terms of the GNU General Public License version 2 as published 
     14 *  by the Free Software Foundation. 
    1015 */ 
    1116 
     
    1520extern int usb_disabled(void); 
    1621 
    17 static void ar71xx_start_ohci(struct platform_device *pdev) 
    18 { 
    19 } 
    20  
    21 static void ar71xx_stop_ohci(struct platform_device *pdev) 
    22 { 
    23         /* 
    24          * TODO: implement 
    25          */ 
    26 } 
    27  
    28 int usb_hcd_ar71xx_probe(const struct hc_driver *driver, 
    29                          struct platform_device *pdev) 
     22static int usb_hcd_ar71xx_probe(const struct hc_driver *driver, 
     23                                struct platform_device *pdev) 
    3024{ 
    3125        struct usb_hcd *hcd; 
     
    6963        } 
    7064 
    71         ar71xx_start_ohci(pdev); 
    7265        ohci_hcd_init(hcd_to_ohci(hcd)); 
    7366 
     
    7871        return 0; 
    7972 
    80 err_stop_hcd: 
    81         ar71xx_stop_ohci(pdev); 
     73 err_stop_hcd: 
    8274        iounmap(hcd->regs); 
    83 err_release_region: 
     75 err_release_region: 
    8476        release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 
    85 err_put_hcd: 
     77 err_put_hcd: 
    8678        usb_put_hcd(hcd); 
    8779        return ret; 
    8880} 
    8981 
    90  
    91 /* may be called without controller electrically present */ 
    92 /* may be called with controller, bus, and devices active */ 
    93  
    94 /** 
    95  * usb_hcd_ar71xx_remove - shutdown processing for AR71xx HCDs 
    96  * @dev: USB Host Controller being removed 
    97  * Context: !in_interrupt() 
    98  * 
    99  * Reverses the effect of usb_hcd_ar71xx_probe(), first invoking 
    100  * the HCD's stop() method.  It is always called from a thread 
    101  * context, normally "rmmod", "apmd", or something similar. 
    102  * 
    103  */ 
    10482void usb_hcd_ar71xx_remove(struct usb_hcd *hcd, struct platform_device *pdev) 
    10583{ 
    10684        usb_remove_hcd(hcd); 
    107         ar71xx_stop_ohci(pdev); 
    10885        iounmap(hcd->regs); 
    10986        release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 
     
    126103        return 0; 
    127104 
    128 err: 
     105 err: 
    129106        ohci_stop(hcd); 
    130107        return ret; 
     
    132109 
    133110static const struct hc_driver ohci_ar71xx_hc_driver = { 
    134         .description    = hcd_name, 
    135         .product_desc   = "Atheros AR71xx built-in OHCI controller", 
    136         .hcd_priv_size  = sizeof(struct ohci_hcd), 
     111        .description            = hcd_name, 
     112        .product_desc           = "Atheros AR71xx built-in OHCI controller", 
     113        .hcd_priv_size          = sizeof(struct ohci_hcd), 
    137114 
    138         /* 
    139          * generic hardware linkage 
    140          */ 
    141         .irq            = ohci_irq, 
    142         .flags          = HCD_USB11 | HCD_MEMORY, 
     115        .irq                    = ohci_irq, 
     116        .flags                  = HCD_USB11 | HCD_MEMORY, 
    143117 
    144         /* 
    145          * basic lifecycle operations 
    146          */ 
    147         .start          = ohci_ar71xx_start, 
    148         .stop           = ohci_stop, 
    149         .shutdown       = ohci_shutdown, 
     118        .start                  = ohci_ar71xx_start, 
     119        .stop                   = ohci_stop, 
     120        .shutdown               = ohci_shutdown, 
    150121 
    151         /* 
    152          * managing i/o requests and associated device resources 
    153          */ 
    154122        .urb_enqueue            = ohci_urb_enqueue, 
    155123        .urb_dequeue            = ohci_urb_dequeue, 
     
    171139static int ohci_hcd_ar71xx_drv_probe(struct platform_device *pdev) 
    172140{ 
    173         int ret; 
     141        if (usb_disabled()) 
     142                return -ENODEV; 
    174143 
    175         ret = -ENODEV; 
    176         if (!usb_disabled()) 
    177                 ret = usb_hcd_ar71xx_probe(&ohci_ar71xx_hc_driver, pdev); 
    178  
    179         return ret; 
     144        return usb_hcd_ar71xx_probe(&ohci_ar71xx_hc_driver, pdev); 
    180145} 
    181146 
     
    188153} 
    189154 
     155MODULE_ALIAS("platform:ar71xx-ohci"); 
     156 
    190157static struct platform_driver ohci_hcd_ar71xx_driver = { 
    191158        .probe          = ohci_hcd_ar71xx_drv_probe, 
     
    197164        }, 
    198165}; 
    199  
    200 MODULE_ALIAS("ar71xx-ohci"); 
Note: See TracChangeset for help on using the changeset viewer.