aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2007-01-23 15:55:28 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 18:44:40 -0500
commit9251644ab33579d80c038b077f78daa23a04fdcd (patch)
treec57746f60a5728537baf03824ed51787e55a3fcc /drivers/usb
parent1096f780d0b9d6bade2d42bf823e81db3e553abe (diff)
usbcore: trivial whitespace fixes
This patch (as844) makes some trivial whitespace fixes to a few files in usbcore. Oliver did most of the work and Alan added some tidying up. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/sysfs.c98
-rw-r--r--drivers/usb/core/urb.c20
-rw-r--r--drivers/usb/core/usb.c96
3 files changed, 107 insertions, 107 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 55d8f575206d..4eaa0ee8e72f 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -16,16 +16,16 @@
16 16
17/* Active configuration fields */ 17/* Active configuration fields */
18#define usb_actconfig_show(field, multiplier, format_string) \ 18#define usb_actconfig_show(field, multiplier, format_string) \
19static ssize_t show_##field (struct device *dev, \ 19static ssize_t show_##field(struct device *dev, \
20 struct device_attribute *attr, char *buf) \ 20 struct device_attribute *attr, char *buf) \
21{ \ 21{ \
22 struct usb_device *udev; \ 22 struct usb_device *udev; \
23 struct usb_host_config *actconfig; \ 23 struct usb_host_config *actconfig; \
24 \ 24 \
25 udev = to_usb_device (dev); \ 25 udev = to_usb_device(dev); \
26 actconfig = udev->actconfig; \ 26 actconfig = udev->actconfig; \
27 if (actconfig) \ 27 if (actconfig) \
28 return sprintf (buf, format_string, \ 28 return sprintf(buf, format_string, \
29 actconfig->desc.field * multiplier); \ 29 actconfig->desc.field * multiplier); \
30 else \ 30 else \
31 return 0; \ 31 return 0; \
@@ -35,9 +35,9 @@ static ssize_t show_##field (struct device *dev, \
35usb_actconfig_show(field, multiplier, format_string) \ 35usb_actconfig_show(field, multiplier, format_string) \
36static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL); 36static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL);
37 37
38usb_actconfig_attr (bNumInterfaces, 1, "%2d\n") 38usb_actconfig_attr(bNumInterfaces, 1, "%2d\n")
39usb_actconfig_attr (bmAttributes, 1, "%2x\n") 39usb_actconfig_attr(bmAttributes, 1, "%2x\n")
40usb_actconfig_attr (bMaxPower, 2, "%3dmA\n") 40usb_actconfig_attr(bMaxPower, 2, "%3dmA\n")
41 41
42static ssize_t show_configuration_string(struct device *dev, 42static ssize_t show_configuration_string(struct device *dev,
43 struct device_attribute *attr, char *buf) 43 struct device_attribute *attr, char *buf)
@@ -45,7 +45,7 @@ static ssize_t show_configuration_string(struct device *dev,
45 struct usb_device *udev; 45 struct usb_device *udev;
46 struct usb_host_config *actconfig; 46 struct usb_host_config *actconfig;
47 47
48 udev = to_usb_device (dev); 48 udev = to_usb_device(dev);
49 actconfig = udev->actconfig; 49 actconfig = udev->actconfig;
50 if ((!actconfig) || (!actconfig->string)) 50 if ((!actconfig) || (!actconfig->string))
51 return 0; 51 return 0;
@@ -57,16 +57,16 @@ static DEVICE_ATTR(configuration, S_IRUGO, show_configuration_string, NULL);
57usb_actconfig_show(bConfigurationValue, 1, "%u\n"); 57usb_actconfig_show(bConfigurationValue, 1, "%u\n");
58 58
59static ssize_t 59static ssize_t
60set_bConfigurationValue (struct device *dev, struct device_attribute *attr, 60set_bConfigurationValue(struct device *dev, struct device_attribute *attr,
61 const char *buf, size_t count) 61 const char *buf, size_t count)
62{ 62{
63 struct usb_device *udev = to_usb_device (dev); 63 struct usb_device *udev = to_usb_device(dev);
64 int config, value; 64 int config, value;
65 65
66 if (sscanf (buf, "%u", &config) != 1 || config > 255) 66 if (sscanf(buf, "%u", &config) != 1 || config > 255)
67 return -EINVAL; 67 return -EINVAL;
68 usb_lock_device(udev); 68 usb_lock_device(udev);
69 value = usb_set_configuration (udev, config); 69 value = usb_set_configuration(udev, config);
70 usb_unlock_device(udev); 70 usb_unlock_device(udev);
71 return (value < 0) ? value : count; 71 return (value < 0) ? value : count;
72} 72}
@@ -81,7 +81,7 @@ static ssize_t show_##name(struct device *dev, \
81{ \ 81{ \
82 struct usb_device *udev; \ 82 struct usb_device *udev; \
83 \ 83 \
84 udev = to_usb_device (dev); \ 84 udev = to_usb_device(dev); \
85 return sprintf(buf, "%s\n", udev->name); \ 85 return sprintf(buf, "%s\n", udev->name); \
86} \ 86} \
87static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL); 87static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL);
@@ -91,12 +91,12 @@ usb_string_attr(manufacturer);
91usb_string_attr(serial); 91usb_string_attr(serial);
92 92
93static ssize_t 93static ssize_t
94show_speed (struct device *dev, struct device_attribute *attr, char *buf) 94show_speed(struct device *dev, struct device_attribute *attr, char *buf)
95{ 95{
96 struct usb_device *udev; 96 struct usb_device *udev;
97 char *speed; 97 char *speed;
98 98
99 udev = to_usb_device (dev); 99 udev = to_usb_device(dev);
100 100
101 switch (udev->speed) { 101 switch (udev->speed) {
102 case USB_SPEED_LOW: 102 case USB_SPEED_LOW:
@@ -112,22 +112,22 @@ show_speed (struct device *dev, struct device_attribute *attr, char *buf)
112 default: 112 default:
113 speed = "unknown"; 113 speed = "unknown";
114 } 114 }
115 return sprintf (buf, "%s\n", speed); 115 return sprintf(buf, "%s\n", speed);
116} 116}
117static DEVICE_ATTR(speed, S_IRUGO, show_speed, NULL); 117static DEVICE_ATTR(speed, S_IRUGO, show_speed, NULL);
118 118
119static ssize_t 119static ssize_t
120show_devnum (struct device *dev, struct device_attribute *attr, char *buf) 120show_devnum(struct device *dev, struct device_attribute *attr, char *buf)
121{ 121{
122 struct usb_device *udev; 122 struct usb_device *udev;
123 123
124 udev = to_usb_device (dev); 124 udev = to_usb_device(dev);
125 return sprintf (buf, "%d\n", udev->devnum); 125 return sprintf(buf, "%d\n", udev->devnum);
126} 126}
127static DEVICE_ATTR(devnum, S_IRUGO, show_devnum, NULL); 127static DEVICE_ATTR(devnum, S_IRUGO, show_devnum, NULL);
128 128
129static ssize_t 129static ssize_t
130show_version (struct device *dev, struct device_attribute *attr, char *buf) 130show_version(struct device *dev, struct device_attribute *attr, char *buf)
131{ 131{
132 struct usb_device *udev; 132 struct usb_device *udev;
133 u16 bcdUSB; 133 u16 bcdUSB;
@@ -139,25 +139,25 @@ show_version (struct device *dev, struct device_attribute *attr, char *buf)
139static DEVICE_ATTR(version, S_IRUGO, show_version, NULL); 139static DEVICE_ATTR(version, S_IRUGO, show_version, NULL);
140 140
141static ssize_t 141static ssize_t
142show_maxchild (struct device *dev, struct device_attribute *attr, char *buf) 142show_maxchild(struct device *dev, struct device_attribute *attr, char *buf)
143{ 143{
144 struct usb_device *udev; 144 struct usb_device *udev;
145 145
146 udev = to_usb_device (dev); 146 udev = to_usb_device(dev);
147 return sprintf (buf, "%d\n", udev->maxchild); 147 return sprintf(buf, "%d\n", udev->maxchild);
148} 148}
149static DEVICE_ATTR(maxchild, S_IRUGO, show_maxchild, NULL); 149static DEVICE_ATTR(maxchild, S_IRUGO, show_maxchild, NULL);
150 150
151/* Descriptor fields */ 151/* Descriptor fields */
152#define usb_descriptor_attr_le16(field, format_string) \ 152#define usb_descriptor_attr_le16(field, format_string) \
153static ssize_t \ 153static ssize_t \
154show_##field (struct device *dev, struct device_attribute *attr, \ 154show_##field(struct device *dev, struct device_attribute *attr, \
155 char *buf) \ 155 char *buf) \
156{ \ 156{ \
157 struct usb_device *udev; \ 157 struct usb_device *udev; \
158 \ 158 \
159 udev = to_usb_device (dev); \ 159 udev = to_usb_device(dev); \
160 return sprintf (buf, format_string, \ 160 return sprintf(buf, format_string, \
161 le16_to_cpu(udev->descriptor.field)); \ 161 le16_to_cpu(udev->descriptor.field)); \
162} \ 162} \
163static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL); 163static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL);
@@ -168,21 +168,21 @@ usb_descriptor_attr_le16(bcdDevice, "%04x\n")
168 168
169#define usb_descriptor_attr(field, format_string) \ 169#define usb_descriptor_attr(field, format_string) \
170static ssize_t \ 170static ssize_t \
171show_##field (struct device *dev, struct device_attribute *attr, \ 171show_##field(struct device *dev, struct device_attribute *attr, \
172 char *buf) \ 172 char *buf) \
173{ \ 173{ \
174 struct usb_device *udev; \ 174 struct usb_device *udev; \
175 \ 175 \
176 udev = to_usb_device (dev); \ 176 udev = to_usb_device(dev); \
177 return sprintf (buf, format_string, udev->descriptor.field); \ 177 return sprintf(buf, format_string, udev->descriptor.field); \
178} \ 178} \
179static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL); 179static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL);
180 180
181usb_descriptor_attr (bDeviceClass, "%02x\n") 181usb_descriptor_attr(bDeviceClass, "%02x\n")
182usb_descriptor_attr (bDeviceSubClass, "%02x\n") 182usb_descriptor_attr(bDeviceSubClass, "%02x\n")
183usb_descriptor_attr (bDeviceProtocol, "%02x\n") 183usb_descriptor_attr(bDeviceProtocol, "%02x\n")
184usb_descriptor_attr (bNumConfigurations, "%d\n") 184usb_descriptor_attr(bNumConfigurations, "%d\n")
185usb_descriptor_attr (bMaxPacketSize0, "%d\n") 185usb_descriptor_attr(bMaxPacketSize0, "%d\n")
186 186
187static struct attribute *dev_attrs[] = { 187static struct attribute *dev_attrs[] = {
188 /* current configuration's attributes */ 188 /* current configuration's attributes */
@@ -220,17 +220,17 @@ int usb_create_sysfs_dev_files(struct usb_device *udev)
220 return retval; 220 return retval;
221 221
222 if (udev->manufacturer) { 222 if (udev->manufacturer) {
223 retval = device_create_file (dev, &dev_attr_manufacturer); 223 retval = device_create_file(dev, &dev_attr_manufacturer);
224 if (retval) 224 if (retval)
225 goto error; 225 goto error;
226 } 226 }
227 if (udev->product) { 227 if (udev->product) {
228 retval = device_create_file (dev, &dev_attr_product); 228 retval = device_create_file(dev, &dev_attr_product);
229 if (retval) 229 if (retval)
230 goto error; 230 goto error;
231 } 231 }
232 if (udev->serial) { 232 if (udev->serial) {
233 retval = device_create_file (dev, &dev_attr_serial); 233 retval = device_create_file(dev, &dev_attr_serial);
234 if (retval) 234 if (retval)
235 goto error; 235 goto error;
236 } 236 }
@@ -246,7 +246,7 @@ error:
246 return retval; 246 return retval;
247} 247}
248 248
249void usb_remove_sysfs_dev_files (struct usb_device *udev) 249void usb_remove_sysfs_dev_files(struct usb_device *udev)
250{ 250{
251 struct device *dev = &udev->dev; 251 struct device *dev = &udev->dev;
252 252
@@ -264,22 +264,22 @@ void usb_remove_sysfs_dev_files (struct usb_device *udev)
264/* Interface fields */ 264/* Interface fields */
265#define usb_intf_attr(field, format_string) \ 265#define usb_intf_attr(field, format_string) \
266static ssize_t \ 266static ssize_t \
267show_##field (struct device *dev, struct device_attribute *attr, \ 267show_##field(struct device *dev, struct device_attribute *attr, \
268 char *buf) \ 268 char *buf) \
269{ \ 269{ \
270 struct usb_interface *intf = to_usb_interface (dev); \ 270 struct usb_interface *intf = to_usb_interface(dev); \
271 \ 271 \
272 return sprintf (buf, format_string, \ 272 return sprintf(buf, format_string, \
273 intf->cur_altsetting->desc.field); \ 273 intf->cur_altsetting->desc.field); \
274} \ 274} \
275static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL); 275static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL);
276 276
277usb_intf_attr (bInterfaceNumber, "%02x\n") 277usb_intf_attr(bInterfaceNumber, "%02x\n")
278usb_intf_attr (bAlternateSetting, "%2d\n") 278usb_intf_attr(bAlternateSetting, "%2d\n")
279usb_intf_attr (bNumEndpoints, "%02x\n") 279usb_intf_attr(bNumEndpoints, "%02x\n")
280usb_intf_attr (bInterfaceClass, "%02x\n") 280usb_intf_attr(bInterfaceClass, "%02x\n")
281usb_intf_attr (bInterfaceSubClass, "%02x\n") 281usb_intf_attr(bInterfaceSubClass, "%02x\n")
282usb_intf_attr (bInterfaceProtocol, "%02x\n") 282usb_intf_attr(bInterfaceProtocol, "%02x\n")
283 283
284static ssize_t show_interface_string(struct device *dev, 284static ssize_t show_interface_string(struct device *dev,
285 struct device_attribute *attr, char *buf) 285 struct device_attribute *attr, char *buf)
@@ -288,8 +288,8 @@ static ssize_t show_interface_string(struct device *dev,
288 struct usb_device *udev; 288 struct usb_device *udev;
289 int len; 289 int len;
290 290
291 intf = to_usb_interface (dev); 291 intf = to_usb_interface(dev);
292 udev = interface_to_usbdev (intf); 292 udev = interface_to_usbdev(intf);
293 len = snprintf(buf, 256, "%s", intf->cur_altsetting->string); 293 len = snprintf(buf, 256, "%s", intf->cur_altsetting->string);
294 if (len < 0) 294 if (len < 0)
295 return 0; 295 return 0;
@@ -384,7 +384,7 @@ error:
384 return retval; 384 return retval;
385} 385}
386 386
387void usb_remove_sysfs_intf_files (struct usb_interface *intf) 387void usb_remove_sysfs_intf_files(struct usb_interface *intf)
388{ 388{
389 usb_remove_intf_ep_files(intf); 389 usb_remove_intf_ep_files(intf);
390 sysfs_remove_group(&intf->dev.kobj, &intf_attr_grp); 390 sysfs_remove_group(&intf->dev.kobj, &intf_attr_grp);
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index a4fa3e66c307..94ea9727ff55 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -240,10 +240,10 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
240 * and don't need to duplicate tests 240 * and don't need to duplicate tests
241 */ 241 */
242 pipe = urb->pipe; 242 pipe = urb->pipe;
243 temp = usb_pipetype (pipe); 243 temp = usb_pipetype(pipe);
244 is_out = usb_pipeout (pipe); 244 is_out = usb_pipeout(pipe);
245 245
246 if (!usb_pipecontrol (pipe) && dev->state < USB_STATE_CONFIGURED) 246 if (!usb_pipecontrol(pipe) && dev->state < USB_STATE_CONFIGURED)
247 return -ENODEV; 247 return -ENODEV;
248 248
249 /* FIXME there should be a sharable lock protecting us against 249 /* FIXME there should be a sharable lock protecting us against
@@ -252,11 +252,11 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
252 * checks get made.) 252 * checks get made.)
253 */ 253 */
254 254
255 max = usb_maxpacket (dev, pipe, is_out); 255 max = usb_maxpacket(dev, pipe, is_out);
256 if (max <= 0) { 256 if (max <= 0) {
257 dev_dbg(&dev->dev, 257 dev_dbg(&dev->dev,
258 "bogus endpoint ep%d%s in %s (bad maxpacket %d)\n", 258 "bogus endpoint ep%d%s in %s (bad maxpacket %d)\n",
259 usb_pipeendpoint (pipe), is_out ? "out" : "in", 259 usb_pipeendpoint(pipe), is_out ? "out" : "in",
260 __FUNCTION__, max); 260 __FUNCTION__, max);
261 return -EMSGSIZE; 261 return -EMSGSIZE;
262 } 262 }
@@ -278,11 +278,11 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
278 if (urb->number_of_packets <= 0) 278 if (urb->number_of_packets <= 0)
279 return -EINVAL; 279 return -EINVAL;
280 for (n = 0; n < urb->number_of_packets; n++) { 280 for (n = 0; n < urb->number_of_packets; n++) {
281 len = urb->iso_frame_desc [n].length; 281 len = urb->iso_frame_desc[n].length;
282 if (len < 0 || len > max) 282 if (len < 0 || len > max)
283 return -EMSGSIZE; 283 return -EMSGSIZE;
284 urb->iso_frame_desc [n].status = -EXDEV; 284 urb->iso_frame_desc[n].status = -EXDEV;
285 urb->iso_frame_desc [n].actual_length = 0; 285 urb->iso_frame_desc[n].actual_length = 0;
286 } 286 }
287 } 287 }
288 288
@@ -321,7 +321,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
321 321
322 /* fail if submitter gave bogus flags */ 322 /* fail if submitter gave bogus flags */
323 if (urb->transfer_flags != orig_flags) { 323 if (urb->transfer_flags != orig_flags) {
324 err ("BOGUS urb flags, %x --> %x", 324 err("BOGUS urb flags, %x --> %x",
325 orig_flags, urb->transfer_flags); 325 orig_flags, urb->transfer_flags);
326 return -EINVAL; 326 return -EINVAL;
327 } 327 }
@@ -372,7 +372,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
372 urb->interval = temp; 372 urb->interval = temp;
373 } 373 }
374 374
375 return usb_hcd_submit_urb (urb, mem_flags); 375 return usb_hcd_submit_urb(urb, mem_flags);
376} 376}
377 377
378/*-------------------------------------------------------------------*/ 378/*-------------------------------------------------------------------*/
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 02426d0b9a34..3db721cd557a 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -233,7 +233,7 @@ static void usb_autosuspend_work(struct work_struct *work)
233 * @parent: hub to which device is connected; null to allocate a root hub 233 * @parent: hub to which device is connected; null to allocate a root hub
234 * @bus: bus used to access the device 234 * @bus: bus used to access the device
235 * @port1: one-based index of port; ignored for root hubs 235 * @port1: one-based index of port; ignored for root hubs
236 * Context: !in_interrupt () 236 * Context: !in_interrupt()
237 * 237 *
238 * Only hub drivers (including virtual root hub drivers for host 238 * Only hub drivers (including virtual root hub drivers for host
239 * controllers) should ever call this. 239 * controllers) should ever call this.
@@ -277,22 +277,22 @@ usb_alloc_dev(struct usb_device *parent, struct usb_bus *bus, unsigned port1)
277 * as stable: bus->busnum changes easily from modprobe order, 277 * as stable: bus->busnum changes easily from modprobe order,
278 * cardbus or pci hotplugging, and so on. 278 * cardbus or pci hotplugging, and so on.
279 */ 279 */
280 if (unlikely (!parent)) { 280 if (unlikely(!parent)) {
281 dev->devpath [0] = '0'; 281 dev->devpath[0] = '0';
282 282
283 dev->dev.parent = bus->controller; 283 dev->dev.parent = bus->controller;
284 sprintf (&dev->dev.bus_id[0], "usb%d", bus->busnum); 284 sprintf(&dev->dev.bus_id[0], "usb%d", bus->busnum);
285 } else { 285 } else {
286 /* match any labeling on the hubs; it's one-based */ 286 /* match any labeling on the hubs; it's one-based */
287 if (parent->devpath [0] == '0') 287 if (parent->devpath[0] == '0')
288 snprintf (dev->devpath, sizeof dev->devpath, 288 snprintf(dev->devpath, sizeof dev->devpath,
289 "%d", port1); 289 "%d", port1);
290 else 290 else
291 snprintf (dev->devpath, sizeof dev->devpath, 291 snprintf(dev->devpath, sizeof dev->devpath,
292 "%s.%d", parent->devpath, port1); 292 "%s.%d", parent->devpath, port1);
293 293
294 dev->dev.parent = &parent->dev; 294 dev->dev.parent = &parent->dev;
295 sprintf (&dev->dev.bus_id[0], "%d-%s", 295 sprintf(&dev->dev.bus_id[0], "%d-%s",
296 bus->busnum, dev->devpath); 296 bus->busnum, dev->devpath);
297 297
298 /* hub driver sets up TT records */ 298 /* hub driver sets up TT records */
@@ -463,7 +463,7 @@ static struct usb_device *match_device(struct usb_device *dev,
463 /* see if this device matches */ 463 /* see if this device matches */
464 if ((vendor_id == le16_to_cpu(dev->descriptor.idVendor)) && 464 if ((vendor_id == le16_to_cpu(dev->descriptor.idVendor)) &&
465 (product_id == le16_to_cpu(dev->descriptor.idProduct))) { 465 (product_id == le16_to_cpu(dev->descriptor.idProduct))) {
466 dev_dbg (&dev->dev, "matched this device!\n"); 466 dev_dbg(&dev->dev, "matched this device!\n");
467 ret_dev = usb_get_dev(dev); 467 ret_dev = usb_get_dev(dev);
468 goto exit; 468 goto exit;
469 } 469 }
@@ -535,7 +535,7 @@ exit:
535 */ 535 */
536int usb_get_current_frame_number(struct usb_device *dev) 536int usb_get_current_frame_number(struct usb_device *dev)
537{ 537{
538 return usb_hcd_get_frame_number (dev); 538 return usb_hcd_get_frame_number(dev);
539} 539}
540 540
541/*-------------------------------------------------------------------*/ 541/*-------------------------------------------------------------------*/
@@ -593,7 +593,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
593 * 593 *
594 * When the buffer is no longer used, free it with usb_buffer_free(). 594 * When the buffer is no longer used, free it with usb_buffer_free().
595 */ 595 */
596void *usb_buffer_alloc ( 596void *usb_buffer_alloc(
597 struct usb_device *dev, 597 struct usb_device *dev,
598 size_t size, 598 size_t size,
599 gfp_t mem_flags, 599 gfp_t mem_flags,
@@ -602,7 +602,7 @@ void *usb_buffer_alloc (
602{ 602{
603 if (!dev || !dev->bus) 603 if (!dev || !dev->bus)
604 return NULL; 604 return NULL;
605 return hcd_buffer_alloc (dev->bus, size, mem_flags, dma); 605 return hcd_buffer_alloc(dev->bus, size, mem_flags, dma);
606} 606}
607 607
608/** 608/**
@@ -616,7 +616,7 @@ void *usb_buffer_alloc (
616 * been allocated using usb_buffer_alloc(), and the parameters must match 616 * been allocated using usb_buffer_alloc(), and the parameters must match
617 * those provided in that allocation request. 617 * those provided in that allocation request.
618 */ 618 */
619void usb_buffer_free ( 619void usb_buffer_free(
620 struct usb_device *dev, 620 struct usb_device *dev,
621 size_t size, 621 size_t size,
622 void *addr, 622 void *addr,
@@ -627,7 +627,7 @@ void usb_buffer_free (
627 return; 627 return;
628 if (!addr) 628 if (!addr)
629 return; 629 return;
630 hcd_buffer_free (dev->bus, size, addr, dma); 630 hcd_buffer_free(dev->bus, size, addr, dma);
631} 631}
632 632
633/** 633/**
@@ -647,7 +647,7 @@ void usb_buffer_free (
647 * Reverse the effect of this call with usb_buffer_unmap(). 647 * Reverse the effect of this call with usb_buffer_unmap().
648 */ 648 */
649#if 0 649#if 0
650struct urb *usb_buffer_map (struct urb *urb) 650struct urb *usb_buffer_map(struct urb *urb)
651{ 651{
652 struct usb_bus *bus; 652 struct usb_bus *bus;
653 struct device *controller; 653 struct device *controller;
@@ -659,14 +659,14 @@ struct urb *usb_buffer_map (struct urb *urb)
659 return NULL; 659 return NULL;
660 660
661 if (controller->dma_mask) { 661 if (controller->dma_mask) {
662 urb->transfer_dma = dma_map_single (controller, 662 urb->transfer_dma = dma_map_single(controller,
663 urb->transfer_buffer, urb->transfer_buffer_length, 663 urb->transfer_buffer, urb->transfer_buffer_length,
664 usb_pipein (urb->pipe) 664 usb_pipein(urb->pipe)
665 ? DMA_FROM_DEVICE : DMA_TO_DEVICE); 665 ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
666 if (usb_pipecontrol (urb->pipe)) 666 if (usb_pipecontrol(urb->pipe))
667 urb->setup_dma = dma_map_single (controller, 667 urb->setup_dma = dma_map_single(controller,
668 urb->setup_packet, 668 urb->setup_packet,
669 sizeof (struct usb_ctrlrequest), 669 sizeof(struct usb_ctrlrequest),
670 DMA_TO_DEVICE); 670 DMA_TO_DEVICE);
671 // FIXME generic api broken like pci, can't report errors 671 // FIXME generic api broken like pci, can't report errors
672 // if (urb->transfer_dma == DMA_ADDR_INVALID) return 0; 672 // if (urb->transfer_dma == DMA_ADDR_INVALID) return 0;
@@ -689,7 +689,7 @@ struct urb *usb_buffer_map (struct urb *urb)
689 * usb_buffer_dmasync - synchronize DMA and CPU view of buffer(s) 689 * usb_buffer_dmasync - synchronize DMA and CPU view of buffer(s)
690 * @urb: urb whose transfer_buffer/setup_packet will be synchronized 690 * @urb: urb whose transfer_buffer/setup_packet will be synchronized
691 */ 691 */
692void usb_buffer_dmasync (struct urb *urb) 692void usb_buffer_dmasync(struct urb *urb)
693{ 693{
694 struct usb_bus *bus; 694 struct usb_bus *bus;
695 struct device *controller; 695 struct device *controller;
@@ -702,14 +702,14 @@ void usb_buffer_dmasync (struct urb *urb)
702 return; 702 return;
703 703
704 if (controller->dma_mask) { 704 if (controller->dma_mask) {
705 dma_sync_single (controller, 705 dma_sync_single(controller,
706 urb->transfer_dma, urb->transfer_buffer_length, 706 urb->transfer_dma, urb->transfer_buffer_length,
707 usb_pipein (urb->pipe) 707 usb_pipein(urb->pipe)
708 ? DMA_FROM_DEVICE : DMA_TO_DEVICE); 708 ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
709 if (usb_pipecontrol (urb->pipe)) 709 if (usb_pipecontrol(urb->pipe))
710 dma_sync_single (controller, 710 dma_sync_single(controller,
711 urb->setup_dma, 711 urb->setup_dma,
712 sizeof (struct usb_ctrlrequest), 712 sizeof(struct usb_ctrlrequest),
713 DMA_TO_DEVICE); 713 DMA_TO_DEVICE);
714 } 714 }
715} 715}
@@ -722,7 +722,7 @@ void usb_buffer_dmasync (struct urb *urb)
722 * Reverses the effect of usb_buffer_map(). 722 * Reverses the effect of usb_buffer_map().
723 */ 723 */
724#if 0 724#if 0
725void usb_buffer_unmap (struct urb *urb) 725void usb_buffer_unmap(struct urb *urb)
726{ 726{
727 struct usb_bus *bus; 727 struct usb_bus *bus;
728 struct device *controller; 728 struct device *controller;
@@ -735,14 +735,14 @@ void usb_buffer_unmap (struct urb *urb)
735 return; 735 return;
736 736
737 if (controller->dma_mask) { 737 if (controller->dma_mask) {
738 dma_unmap_single (controller, 738 dma_unmap_single(controller,
739 urb->transfer_dma, urb->transfer_buffer_length, 739 urb->transfer_dma, urb->transfer_buffer_length,
740 usb_pipein (urb->pipe) 740 usb_pipein(urb->pipe)
741 ? DMA_FROM_DEVICE : DMA_TO_DEVICE); 741 ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
742 if (usb_pipecontrol (urb->pipe)) 742 if (usb_pipecontrol(urb->pipe))
743 dma_unmap_single (controller, 743 dma_unmap_single(controller,
744 urb->setup_dma, 744 urb->setup_dma,
745 sizeof (struct usb_ctrlrequest), 745 sizeof(struct usb_ctrlrequest),
746 DMA_TO_DEVICE); 746 DMA_TO_DEVICE);
747 } 747 }
748 urb->transfer_flags &= ~(URB_NO_TRANSFER_DMA_MAP 748 urb->transfer_flags &= ~(URB_NO_TRANSFER_DMA_MAP
@@ -783,15 +783,15 @@ int usb_buffer_map_sg(const struct usb_device *dev, unsigned pipe,
783 struct device *controller; 783 struct device *controller;
784 784
785 if (!dev 785 if (!dev
786 || usb_pipecontrol (pipe) 786 || usb_pipecontrol(pipe)
787 || !(bus = dev->bus) 787 || !(bus = dev->bus)
788 || !(controller = bus->controller) 788 || !(controller = bus->controller)
789 || !controller->dma_mask) 789 || !controller->dma_mask)
790 return -1; 790 return -1;
791 791
792 // FIXME generic api broken like pci, can't report errors 792 // FIXME generic api broken like pci, can't report errors
793 return dma_map_sg (controller, sg, nents, 793 return dma_map_sg(controller, sg, nents,
794 usb_pipein (pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE); 794 usb_pipein(pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
795} 795}
796 796
797/* XXX DISABLED, no users currently. If you wish to re-enable this 797/* XXX DISABLED, no users currently. If you wish to re-enable this
@@ -823,8 +823,8 @@ void usb_buffer_dmasync_sg(const struct usb_device *dev, unsigned pipe,
823 || !controller->dma_mask) 823 || !controller->dma_mask)
824 return; 824 return;
825 825
826 dma_sync_sg (controller, sg, n_hw_ents, 826 dma_sync_sg(controller, sg, n_hw_ents,
827 usb_pipein (pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE); 827 usb_pipein(pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
828} 828}
829#endif 829#endif
830 830
@@ -849,8 +849,8 @@ void usb_buffer_unmap_sg(const struct usb_device *dev, unsigned pipe,
849 || !controller->dma_mask) 849 || !controller->dma_mask)
850 return; 850 return;
851 851
852 dma_unmap_sg (controller, sg, n_hw_ents, 852 dma_unmap_sg(controller, sg, n_hw_ents,
853 usb_pipein (pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE); 853 usb_pipein(pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
854} 854}
855 855
856/* format to disable USB on kernel command line is: nousb */ 856/* format to disable USB on kernel command line is: nousb */
@@ -871,7 +871,7 @@ static int __init usb_init(void)
871{ 871{
872 int retval; 872 int retval;
873 if (nousb) { 873 if (nousb) {
874 pr_info ("%s: USB support disabled\n", usbcore_name); 874 pr_info("%s: USB support disabled\n", usbcore_name);
875 return 0; 875 return 0;
876 } 876 }
877 877
@@ -971,19 +971,19 @@ EXPORT_SYMBOL(__usb_get_extra_descriptor);
971EXPORT_SYMBOL(usb_find_device); 971EXPORT_SYMBOL(usb_find_device);
972EXPORT_SYMBOL(usb_get_current_frame_number); 972EXPORT_SYMBOL(usb_get_current_frame_number);
973 973
974EXPORT_SYMBOL (usb_buffer_alloc); 974EXPORT_SYMBOL(usb_buffer_alloc);
975EXPORT_SYMBOL (usb_buffer_free); 975EXPORT_SYMBOL(usb_buffer_free);
976 976
977#if 0 977#if 0
978EXPORT_SYMBOL (usb_buffer_map); 978EXPORT_SYMBOL(usb_buffer_map);
979EXPORT_SYMBOL (usb_buffer_dmasync); 979EXPORT_SYMBOL(usb_buffer_dmasync);
980EXPORT_SYMBOL (usb_buffer_unmap); 980EXPORT_SYMBOL(usb_buffer_unmap);
981#endif 981#endif
982 982
983EXPORT_SYMBOL (usb_buffer_map_sg); 983EXPORT_SYMBOL(usb_buffer_map_sg);
984#if 0 984#if 0
985EXPORT_SYMBOL (usb_buffer_dmasync_sg); 985EXPORT_SYMBOL(usb_buffer_dmasync_sg);
986#endif 986#endif
987EXPORT_SYMBOL (usb_buffer_unmap_sg); 987EXPORT_SYMBOL(usb_buffer_unmap_sg);
988 988
989MODULE_LICENSE("GPL"); 989MODULE_LICENSE("GPL");