diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-26 05:37:46 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-24 07:30:13 -0400 |
commit | 9cb0f819eb88f573703e9a73d9883febcfcfa1c3 (patch) | |
tree | e5d95134614cca94e951e8156dc0dc9901467f23 | |
parent | 876c1f27852ff1e45e1164da15847d3b25600160 (diff) |
USB: sa1111: sparse and checkpatch cleanups
Clean up the ohci-sa1111 driver formatting to be more compliant with
current standards, and add 'static' to various function definitions
to avoid sparse complaints about undeclared functions. Remove the
unnecessary local declaration of 'usb_disabled', which can be found
instead in linux/usb.h.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | drivers/usb/host/ohci-sa1111.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c index 585e53eabff6..50ebeb310fda 100644 --- a/drivers/usb/host/ohci-sa1111.c +++ b/drivers/usb/host/ohci-sa1111.c | |||
@@ -41,8 +41,6 @@ | |||
41 | #define USB_STATUS_NHCIMFCLR (1 << 10) | 41 | #define USB_STATUS_NHCIMFCLR (1 << 10) |
42 | #define USB_STATUS_USBPWRSENSE (1 << 11) | 42 | #define USB_STATUS_USBPWRSENSE (1 << 11) |
43 | 43 | ||
44 | extern int usb_disabled(void); | ||
45 | |||
46 | /*-------------------------------------------------------------------------*/ | 44 | /*-------------------------------------------------------------------------*/ |
47 | 45 | ||
48 | static int sa1111_start_hc(struct sa1111_dev *dev) | 46 | static int sa1111_start_hc(struct sa1111_dev *dev) |
@@ -82,6 +80,7 @@ static int sa1111_start_hc(struct sa1111_dev *dev) | |||
82 | static void sa1111_stop_hc(struct sa1111_dev *dev) | 80 | static void sa1111_stop_hc(struct sa1111_dev *dev) |
83 | { | 81 | { |
84 | unsigned int usb_rst; | 82 | unsigned int usb_rst; |
83 | |||
85 | printk(KERN_DEBUG "%s: stopping SA-1111 OHCI USB Controller\n", | 84 | printk(KERN_DEBUG "%s: stopping SA-1111 OHCI USB Controller\n", |
86 | __FILE__); | 85 | __FILE__); |
87 | 86 | ||
@@ -106,7 +105,7 @@ static void dump_hci_status(struct usb_hcd *hcd, const char *label) | |||
106 | { | 105 | { |
107 | unsigned long status = sa1111_readl(hcd->regs + USB_STATUS); | 106 | unsigned long status = sa1111_readl(hcd->regs + USB_STATUS); |
108 | 107 | ||
109 | dbg ("%s USB_STATUS = { %s%s%s%s%s}", label, | 108 | dbg("%s USB_STATUS = { %s%s%s%s%s}", label, |
110 | ((status & USB_STATUS_IRQHCIRMTWKUP) ? "IRQHCIRMTWKUP " : ""), | 109 | ((status & USB_STATUS_IRQHCIRMTWKUP) ? "IRQHCIRMTWKUP " : ""), |
111 | ((status & USB_STATUS_IRQHCIBUFFACC) ? "IRQHCIBUFFACC " : ""), | 110 | ((status & USB_STATUS_IRQHCIBUFFACC) ? "IRQHCIBUFFACC " : ""), |
112 | ((status & USB_STATUS_NIRQHCIM) ? "" : "IRQHCIM "), | 111 | ((status & USB_STATUS_NIRQHCIM) ? "" : "IRQHCIM "), |
@@ -131,15 +130,16 @@ static void dump_hci_status(struct usb_hcd *hcd, const char *label) | |||
131 | * | 130 | * |
132 | * Store this function in the HCD's struct pci_driver as probe(). | 131 | * Store this function in the HCD's struct pci_driver as probe(). |
133 | */ | 132 | */ |
134 | int usb_hcd_sa1111_probe (const struct hc_driver *driver, | 133 | static int usb_hcd_sa1111_probe(const struct hc_driver *driver, |
135 | struct sa1111_dev *dev) | 134 | struct sa1111_dev *dev) |
136 | { | 135 | { |
137 | struct usb_hcd *hcd; | 136 | struct usb_hcd *hcd; |
138 | int retval; | 137 | int retval; |
139 | 138 | ||
140 | hcd = usb_create_hcd (driver, &dev->dev, "sa1111"); | 139 | hcd = usb_create_hcd(driver, &dev->dev, "sa1111"); |
141 | if (!hcd) | 140 | if (!hcd) |
142 | return -ENOMEM; | 141 | return -ENOMEM; |
142 | |||
143 | hcd->rsrc_start = dev->res.start; | 143 | hcd->rsrc_start = dev->res.start; |
144 | hcd->rsrc_len = resource_size(&dev->res); | 144 | hcd->rsrc_len = resource_size(&dev->res); |
145 | 145 | ||
@@ -148,6 +148,7 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, | |||
148 | retval = -EBUSY; | 148 | retval = -EBUSY; |
149 | goto err1; | 149 | goto err1; |
150 | } | 150 | } |
151 | |||
151 | hcd->regs = dev->mapbase; | 152 | hcd->regs = dev->mapbase; |
152 | 153 | ||
153 | ret = sa1111_start_hc(dev); | 154 | ret = sa1111_start_hc(dev); |
@@ -180,9 +181,8 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, | |||
180 | * Reverses the effect of usb_hcd_sa1111_probe(), first invoking | 181 | * Reverses the effect of usb_hcd_sa1111_probe(), first invoking |
181 | * the HCD's stop() method. It is always called from a thread | 182 | * the HCD's stop() method. It is always called from a thread |
182 | * context, normally "rmmod", "apmd", or something similar. | 183 | * context, normally "rmmod", "apmd", or something similar. |
183 | * | ||
184 | */ | 184 | */ |
185 | void usb_hcd_sa1111_remove (struct usb_hcd *hcd, struct sa1111_dev *dev) | 185 | static void usb_hcd_sa1111_remove(struct usb_hcd *hcd, struct sa1111_dev *dev) |
186 | { | 186 | { |
187 | usb_remove_hcd(hcd); | 187 | usb_remove_hcd(hcd); |
188 | sa1111_stop_hc(dev); | 188 | sa1111_stop_hc(dev); |
@@ -192,18 +192,19 @@ void usb_hcd_sa1111_remove (struct usb_hcd *hcd, struct sa1111_dev *dev) | |||
192 | 192 | ||
193 | /*-------------------------------------------------------------------------*/ | 193 | /*-------------------------------------------------------------------------*/ |
194 | 194 | ||
195 | static int __devinit | 195 | static int __devinit ohci_sa1111_start(struct usb_hcd *hcd) |
196 | ohci_sa1111_start (struct usb_hcd *hcd) | ||
197 | { | 196 | { |
198 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 197 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
199 | int ret; | 198 | int ret; |
200 | 199 | ||
201 | if ((ret = ohci_init(ohci)) < 0) | 200 | ret = ohci_init(ohci); |
201 | if (ret < 0) | ||
202 | return ret; | 202 | return ret; |
203 | 203 | ||
204 | if ((ret = ohci_run (ohci)) < 0) { | 204 | ret = ohci_run(ohci); |
205 | err ("can't start %s", hcd->self.bus_name); | 205 | if (ret < 0) { |
206 | ohci_stop (hcd); | 206 | err("can't start %s", hcd->self.bus_name); |
207 | ohci_stop(hcd); | ||
207 | return ret; | 208 | return ret; |
208 | } | 209 | } |
209 | return 0; | 210 | return 0; |