drivers: usb: core: {file,hub,sysfs,usb}.c: Whitespace fixes
including: - removing of trailing whitespace - removing spaces before array indexing (foo [] to foo[]) - reindention of a switch-case block - spaces to tabs Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
a91ccd26e7
commit
469271f8c4
@@ -8,7 +8,7 @@
|
|||||||
* (C) Copyright Deti Fliegl 1999 (new USB architecture)
|
* (C) Copyright Deti Fliegl 1999 (new USB architecture)
|
||||||
* (C) Copyright Randy Dunlap 2000
|
* (C) Copyright Randy Dunlap 2000
|
||||||
* (C) Copyright David Brownell 2000-2001 (kernel hotplug, usb_device_id,
|
* (C) Copyright David Brownell 2000-2001 (kernel hotplug, usb_device_id,
|
||||||
more docs, etc)
|
* more docs, etc)
|
||||||
* (C) Copyright Yggdrasil Computing, Inc. 2000
|
* (C) Copyright Yggdrasil Computing, Inc. 2000
|
||||||
* (usb_device_id matching changes by Adam J. Richter)
|
* (usb_device_id matching changes by Adam J. Richter)
|
||||||
* (C) Copyright Greg Kroah-Hartman 2002-2003
|
* (C) Copyright Greg Kroah-Hartman 2002-2003
|
||||||
@@ -44,7 +44,7 @@ static int usb_open(struct inode * inode, struct file * file)
|
|||||||
file->f_op = new_fops;
|
file->f_op = new_fops;
|
||||||
/* Curiouser and curiouser... NULL ->open() as "no device" ? */
|
/* Curiouser and curiouser... NULL ->open() as "no device" ? */
|
||||||
if (file->f_op->open)
|
if (file->f_op->open)
|
||||||
err = file->f_op->open(inode,file);
|
err = file->f_op->open(inode, file);
|
||||||
if (err) {
|
if (err) {
|
||||||
fops_put(file->f_op);
|
fops_put(file->f_op);
|
||||||
file->f_op = fops_get(old_fops);
|
file->f_op = fops_get(old_fops);
|
||||||
|
@@ -120,7 +120,7 @@ static inline char *portspeed(struct usb_hub *hub, int portstatus)
|
|||||||
if (hub_is_superspeed(hub->hdev))
|
if (hub_is_superspeed(hub->hdev))
|
||||||
return "5.0 Gb/s";
|
return "5.0 Gb/s";
|
||||||
if (portstatus & USB_PORT_STAT_HIGH_SPEED)
|
if (portstatus & USB_PORT_STAT_HIGH_SPEED)
|
||||||
return "480 Mb/s";
|
return "480 Mb/s";
|
||||||
else if (portstatus & USB_PORT_STAT_LOW_SPEED)
|
else if (portstatus & USB_PORT_STAT_LOW_SPEED)
|
||||||
return "1.5 Mb/s";
|
return "1.5 Mb/s";
|
||||||
else
|
else
|
||||||
@@ -961,7 +961,7 @@ static void hub_port_logical_disconnect(struct usb_hub *hub, int port1)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
set_bit(port1, hub->change_bits);
|
set_bit(port1, hub->change_bits);
|
||||||
kick_khubd(hub);
|
kick_khubd(hub);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1366,7 +1366,7 @@ static int hub_configure(struct usb_hub *hub,
|
|||||||
if ((wHubCharacteristics & HUB_CHAR_COMPOUND) &&
|
if ((wHubCharacteristics & HUB_CHAR_COMPOUND) &&
|
||||||
!(hub_is_superspeed(hdev))) {
|
!(hub_is_superspeed(hdev))) {
|
||||||
int i;
|
int i;
|
||||||
char portstr [USB_MAXCHILDREN + 1];
|
char portstr[USB_MAXCHILDREN + 1];
|
||||||
|
|
||||||
for (i = 0; i < hdev->maxchild; i++)
|
for (i = 0; i < hdev->maxchild; i++)
|
||||||
portstr[i] = hub->descriptor->u.hs.DeviceRemovable
|
portstr[i] = hub->descriptor->u.hs.DeviceRemovable
|
||||||
@@ -1434,32 +1434,32 @@ static int hub_configure(struct usb_hub *hub,
|
|||||||
|
|
||||||
/* Note 8 FS bit times == (8 bits / 12000000 bps) ~= 666ns */
|
/* Note 8 FS bit times == (8 bits / 12000000 bps) ~= 666ns */
|
||||||
switch (wHubCharacteristics & HUB_CHAR_TTTT) {
|
switch (wHubCharacteristics & HUB_CHAR_TTTT) {
|
||||||
case HUB_TTTT_8_BITS:
|
case HUB_TTTT_8_BITS:
|
||||||
if (hdev->descriptor.bDeviceProtocol != 0) {
|
if (hdev->descriptor.bDeviceProtocol != 0) {
|
||||||
hub->tt.think_time = 666;
|
hub->tt.think_time = 666;
|
||||||
dev_dbg(hub_dev, "TT requires at most %d "
|
|
||||||
"FS bit times (%d ns)\n",
|
|
||||||
8, hub->tt.think_time);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case HUB_TTTT_16_BITS:
|
|
||||||
hub->tt.think_time = 666 * 2;
|
|
||||||
dev_dbg(hub_dev, "TT requires at most %d "
|
dev_dbg(hub_dev, "TT requires at most %d "
|
||||||
"FS bit times (%d ns)\n",
|
"FS bit times (%d ns)\n",
|
||||||
16, hub->tt.think_time);
|
8, hub->tt.think_time);
|
||||||
break;
|
}
|
||||||
case HUB_TTTT_24_BITS:
|
break;
|
||||||
hub->tt.think_time = 666 * 3;
|
case HUB_TTTT_16_BITS:
|
||||||
dev_dbg(hub_dev, "TT requires at most %d "
|
hub->tt.think_time = 666 * 2;
|
||||||
"FS bit times (%d ns)\n",
|
dev_dbg(hub_dev, "TT requires at most %d "
|
||||||
24, hub->tt.think_time);
|
"FS bit times (%d ns)\n",
|
||||||
break;
|
16, hub->tt.think_time);
|
||||||
case HUB_TTTT_32_BITS:
|
break;
|
||||||
hub->tt.think_time = 666 * 4;
|
case HUB_TTTT_24_BITS:
|
||||||
dev_dbg(hub_dev, "TT requires at most %d "
|
hub->tt.think_time = 666 * 3;
|
||||||
"FS bit times (%d ns)\n",
|
dev_dbg(hub_dev, "TT requires at most %d "
|
||||||
32, hub->tt.think_time);
|
"FS bit times (%d ns)\n",
|
||||||
break;
|
24, hub->tt.think_time);
|
||||||
|
break;
|
||||||
|
case HUB_TTTT_32_BITS:
|
||||||
|
hub->tt.think_time = 666 * 4;
|
||||||
|
dev_dbg(hub_dev, "TT requires at most %d "
|
||||||
|
"FS bit times (%d ns)\n",
|
||||||
|
32, hub->tt.think_time);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* probe() zeroes hub->indicator[] */
|
/* probe() zeroes hub->indicator[] */
|
||||||
@@ -1565,7 +1565,7 @@ static int hub_configure(struct usb_hub *hub,
|
|||||||
|
|
||||||
/* maybe cycle the hub leds */
|
/* maybe cycle the hub leds */
|
||||||
if (hub->has_indicators && blinkenlights)
|
if (hub->has_indicators && blinkenlights)
|
||||||
hub->indicator [0] = INDICATOR_CYCLE;
|
hub->indicator[0] = INDICATOR_CYCLE;
|
||||||
|
|
||||||
for (i = 0; i < hdev->maxchild; i++) {
|
for (i = 0; i < hdev->maxchild; i++) {
|
||||||
ret = usb_hub_create_port_device(hub, i + 1);
|
ret = usb_hub_create_port_device(hub, i + 1);
|
||||||
@@ -1983,7 +1983,7 @@ static void choose_devnum(struct usb_device *udev)
|
|||||||
if (devnum >= 128)
|
if (devnum >= 128)
|
||||||
devnum = find_next_zero_bit(bus->devmap.devicemap,
|
devnum = find_next_zero_bit(bus->devmap.devicemap,
|
||||||
128, 1);
|
128, 1);
|
||||||
bus->devnum_next = ( devnum >= 127 ? 1 : devnum + 1);
|
bus->devnum_next = (devnum >= 127 ? 1 : devnum + 1);
|
||||||
}
|
}
|
||||||
if (devnum < 128) {
|
if (devnum < 128) {
|
||||||
set_bit(devnum, bus->devmap.devicemap);
|
set_bit(devnum, bus->devmap.devicemap);
|
||||||
@@ -2237,8 +2237,7 @@ static int usb_enumerate_device(struct usb_device *udev)
|
|||||||
udev->product = kstrdup("n/a (unauthorized)", GFP_KERNEL);
|
udev->product = kstrdup("n/a (unauthorized)", GFP_KERNEL);
|
||||||
udev->manufacturer = kstrdup("n/a (unauthorized)", GFP_KERNEL);
|
udev->manufacturer = kstrdup("n/a (unauthorized)", GFP_KERNEL);
|
||||||
udev->serial = kstrdup("n/a (unauthorized)", GFP_KERNEL);
|
udev->serial = kstrdup("n/a (unauthorized)", GFP_KERNEL);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
/* read the standard strings and cache them if present */
|
/* read the standard strings and cache them if present */
|
||||||
udev->product = usb_cache_string(udev, udev->descriptor.iProduct);
|
udev->product = usb_cache_string(udev, udev->descriptor.iProduct);
|
||||||
udev->manufacturer = usb_cache_string(udev,
|
udev->manufacturer = usb_cache_string(udev,
|
||||||
@@ -3113,8 +3112,8 @@ static int finish_port_resume(struct usb_device *udev)
|
|||||||
retry_reset_resume:
|
retry_reset_resume:
|
||||||
status = usb_reset_and_verify_device(udev);
|
status = usb_reset_and_verify_device(udev);
|
||||||
|
|
||||||
/* 10.5.4.5 says be sure devices in the tree are still there.
|
/* 10.5.4.5 says be sure devices in the tree are still there.
|
||||||
* For now let's assume the device didn't go crazy on resume,
|
* For now let's assume the device didn't go crazy on resume,
|
||||||
* and device drivers will know about any resume quirks.
|
* and device drivers will know about any resume quirks.
|
||||||
*/
|
*/
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
@@ -4135,11 +4134,11 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
|
|||||||
#undef GET_DESCRIPTOR_BUFSIZE
|
#undef GET_DESCRIPTOR_BUFSIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If device is WUSB, we already assigned an
|
* If device is WUSB, we already assigned an
|
||||||
* unauthorized address in the Connect Ack sequence;
|
* unauthorized address in the Connect Ack sequence;
|
||||||
* authorization will assign the final address.
|
* authorization will assign the final address.
|
||||||
*/
|
*/
|
||||||
if (udev->wusb == 0) {
|
if (udev->wusb == 0) {
|
||||||
for (j = 0; j < SET_ADDRESS_TRIES; ++j) {
|
for (j = 0; j < SET_ADDRESS_TRIES; ++j) {
|
||||||
retval = hub_set_address(udev, devnum);
|
retval = hub_set_address(udev, devnum);
|
||||||
@@ -4168,7 +4167,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
|
|||||||
msleep(10);
|
msleep(10);
|
||||||
if (USE_NEW_SCHEME(retry_counter) && !(hcd->driver->flags & HCD_USB3))
|
if (USE_NEW_SCHEME(retry_counter) && !(hcd->driver->flags & HCD_USB3))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = usb_get_device_descriptor(udev, 8);
|
retval = usb_get_device_descriptor(udev, 8);
|
||||||
if (retval < 8) {
|
if (retval < 8) {
|
||||||
@@ -4321,7 +4320,7 @@ hub_power_remaining (struct usb_hub *hub)
|
|||||||
}
|
}
|
||||||
if (remaining < 0) {
|
if (remaining < 0) {
|
||||||
dev_warn(hub->intfdev, "%dmA over power budget!\n",
|
dev_warn(hub->intfdev, "%dmA over power budget!\n",
|
||||||
- remaining);
|
-remaining);
|
||||||
remaining = 0;
|
remaining = 0;
|
||||||
}
|
}
|
||||||
return remaining;
|
return remaining;
|
||||||
@@ -4432,7 +4431,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
|
|||||||
set_port_feature(hdev, port1, USB_PORT_FEAT_POWER);
|
set_port_feature(hdev, port1, USB_PORT_FEAT_POWER);
|
||||||
|
|
||||||
if (portstatus & USB_PORT_STAT_ENABLE)
|
if (portstatus & USB_PORT_STAT_ENABLE)
|
||||||
goto done;
|
goto done;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (hub_is_superspeed(hub->hdev))
|
if (hub_is_superspeed(hub->hdev))
|
||||||
@@ -4455,7 +4454,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
usb_set_device_state(udev, USB_STATE_POWERED);
|
usb_set_device_state(udev, USB_STATE_POWERED);
|
||||||
udev->bus_mA = hub->mA_per_port;
|
udev->bus_mA = hub->mA_per_port;
|
||||||
udev->level = hdev->level + 1;
|
udev->level = hdev->level + 1;
|
||||||
udev->wusb = hub_is_wusb(hub);
|
udev->wusb = hub_is_wusb(hub);
|
||||||
|
|
||||||
@@ -4846,7 +4845,7 @@ static void hub_events(void)
|
|||||||
dev_dbg(hub_dev, "over-current change\n");
|
dev_dbg(hub_dev, "over-current change\n");
|
||||||
clear_hub_feature(hdev, C_HUB_OVER_CURRENT);
|
clear_hub_feature(hdev, C_HUB_OVER_CURRENT);
|
||||||
msleep(500); /* Cool down */
|
msleep(500); /* Cool down */
|
||||||
hub_power_on(hub, true);
|
hub_power_on(hub, true);
|
||||||
hub_hub_status(hub, &status, &unused);
|
hub_hub_status(hub, &status, &unused);
|
||||||
if (status & HUB_STATUS_OVERCURRENT)
|
if (status & HUB_STATUS_OVERCURRENT)
|
||||||
dev_err(hub_dev, "over-current "
|
dev_err(hub_dev, "over-current "
|
||||||
@@ -4866,7 +4865,7 @@ static void hub_events(void)
|
|||||||
usb_unlock_device(hdev);
|
usb_unlock_device(hdev);
|
||||||
kref_put(&hub->kref, hub_release);
|
kref_put(&hub->kref, hub_release);
|
||||||
|
|
||||||
} /* end while (1) */
|
} /* end while (1) */
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hub_thread(void *__unused)
|
static int hub_thread(void *__unused)
|
||||||
@@ -4891,7 +4890,7 @@ static int hub_thread(void *__unused)
|
|||||||
|
|
||||||
static const struct usb_device_id hub_id_table[] = {
|
static const struct usb_device_id hub_id_table[] = {
|
||||||
{ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
|
{ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
|
||||||
| USB_DEVICE_ID_MATCH_INT_CLASS,
|
| USB_DEVICE_ID_MATCH_INT_CLASS,
|
||||||
.idVendor = USB_VENDOR_GENESYS_LOGIC,
|
.idVendor = USB_VENDOR_GENESYS_LOGIC,
|
||||||
.bInterfaceClass = USB_CLASS_HUB,
|
.bInterfaceClass = USB_CLASS_HUB,
|
||||||
.driver_info = HUB_QUIRK_CHECK_PORT_AUTOSUSPEND},
|
.driver_info = HUB_QUIRK_CHECK_PORT_AUTOSUSPEND},
|
||||||
@@ -5131,7 +5130,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
|
|||||||
dev_info(&udev->dev, "device firmware changed\n");
|
dev_info(&udev->dev, "device firmware changed\n");
|
||||||
udev->descriptor = descriptor; /* for disconnect() calls */
|
udev->descriptor = descriptor; /* for disconnect() calls */
|
||||||
goto re_enumerate;
|
goto re_enumerate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore the device's previous configuration */
|
/* Restore the device's previous configuration */
|
||||||
if (!udev->actconfig)
|
if (!udev->actconfig)
|
||||||
@@ -5156,7 +5155,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
|
|||||||
udev->actconfig->desc.bConfigurationValue, ret);
|
udev->actconfig->desc.bConfigurationValue, ret);
|
||||||
mutex_unlock(hcd->bandwidth_mutex);
|
mutex_unlock(hcd->bandwidth_mutex);
|
||||||
goto re_enumerate;
|
goto re_enumerate;
|
||||||
}
|
}
|
||||||
mutex_unlock(hcd->bandwidth_mutex);
|
mutex_unlock(hcd->bandwidth_mutex);
|
||||||
usb_set_device_state(udev, USB_STATE_CONFIGURED);
|
usb_set_device_state(udev, USB_STATE_CONFIGURED);
|
||||||
|
|
||||||
|
@@ -398,7 +398,8 @@ static DEVICE_ATTR_RW(autosuspend);
|
|||||||
static const char on_string[] = "on";
|
static const char on_string[] = "on";
|
||||||
static const char auto_string[] = "auto";
|
static const char auto_string[] = "auto";
|
||||||
|
|
||||||
static void warn_level(void) {
|
static void warn_level(void)
|
||||||
|
{
|
||||||
static int level_warned;
|
static int level_warned;
|
||||||
|
|
||||||
if (!level_warned) {
|
if (!level_warned) {
|
||||||
@@ -652,7 +653,7 @@ static ssize_t authorized_store(struct device *dev,
|
|||||||
result = usb_deauthorize_device(usb_dev);
|
result = usb_deauthorize_device(usb_dev);
|
||||||
else
|
else
|
||||||
result = usb_authorize_device(usb_dev);
|
result = usb_authorize_device(usb_dev);
|
||||||
return result < 0? result : size;
|
return result < 0 ? result : size;
|
||||||
}
|
}
|
||||||
static DEVICE_ATTR_IGNORE_LOCKDEP(authorized, S_IRUGO | S_IWUSR,
|
static DEVICE_ATTR_IGNORE_LOCKDEP(authorized, S_IRUGO | S_IWUSR,
|
||||||
authorized_show, authorized_store);
|
authorized_show, authorized_store);
|
||||||
|
@@ -497,7 +497,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
|
|||||||
dev->authorized = 1;
|
dev->authorized = 1;
|
||||||
else {
|
else {
|
||||||
dev->authorized = usb_hcd->authorized_default;
|
dev->authorized = usb_hcd->authorized_default;
|
||||||
dev->wusb = usb_bus_is_wusb(bus)? 1 : 0;
|
dev->wusb = usb_bus_is_wusb(bus) ? 1 : 0;
|
||||||
}
|
}
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user