usb: ftdi-elan: Convert leading spaces to tabs

Use tabs for indentation.
Use a more normal kernel comment style (align multiline *'s)

git diff -w shows no differences

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Joe Perches 2014-04-04 15:16:04 -07:00 committed by Greg Kroah-Hartman
parent 90ba4f7919
commit 8dae693ca9

View file

@ -1,40 +1,40 @@
/*
* USB FTDI client driver for Elan Digital Systems's Uxxx adapters
*
* Copyright(C) 2006 Elan Digital Systems Limited
* http://www.elandigitalsystems.com
*
* Author and Maintainer - Tony Olech - Elan Digital Systems
* tony.olech@elandigitalsystems.com
*
* This program is free software;you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2.
*
*
* This driver was written by Tony Olech(tony.olech@elandigitalsystems.com)
* based on various USB client drivers in the 2.6.15 linux kernel
* with constant reference to the 3rd Edition of Linux Device Drivers
* published by O'Reilly
*
* The U132 adapter is a USB to CardBus adapter specifically designed
* for PC cards that contain an OHCI host controller. Typical PC cards
* are the Orange Mobile 3G Option GlobeTrotter Fusion card.
*
* The U132 adapter will *NOT *work with PC cards that do not contain
* an OHCI controller. A simple way to test whether a PC card has an
* OHCI controller as an interface is to insert the PC card directly
* into a laptop(or desktop) with a CardBus slot and if "lspci" shows
* a new USB controller and "lsusb -v" shows a new OHCI Host Controller
* then there is a good chance that the U132 adapter will support the
* PC card.(you also need the specific client driver for the PC card)
*
* Please inform the Author and Maintainer about any PC cards that
* contain OHCI Host Controller and work when directly connected to
* an embedded CardBus slot but do not work when they are connected
* via an ELAN U132 adapter.
*
*/
* USB FTDI client driver for Elan Digital Systems's Uxxx adapters
*
* Copyright(C) 2006 Elan Digital Systems Limited
* http://www.elandigitalsystems.com
*
* Author and Maintainer - Tony Olech - Elan Digital Systems
* tony.olech@elandigitalsystems.com
*
* This program is free software;you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2.
*
*
* This driver was written by Tony Olech(tony.olech@elandigitalsystems.com)
* based on various USB client drivers in the 2.6.15 linux kernel
* with constant reference to the 3rd Edition of Linux Device Drivers
* published by O'Reilly
*
* The U132 adapter is a USB to CardBus adapter specifically designed
* for PC cards that contain an OHCI host controller. Typical PC cards
* are the Orange Mobile 3G Option GlobeTrotter Fusion card.
*
* The U132 adapter will *NOT *work with PC cards that do not contain
* an OHCI controller. A simple way to test whether a PC card has an
* OHCI controller as an interface is to insert the PC card directly
* into a laptop(or desktop) with a CardBus slot and if "lspci" shows
* a new USB controller and "lsusb -v" shows a new OHCI Host Controller
* then there is a good chance that the U132 adapter will support the
* PC card.(you also need the specific client driver for the PC card)
*
* Please inform the Author and Maintainer about any PC cards that
* contain OHCI Host Controller and work when directly connected to
* an embedded CardBus slot but do not work when they are connected
* via an ELAN U132 adapter.
*
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
@ -62,20 +62,20 @@ static struct workqueue_struct *status_queue;
static struct workqueue_struct *command_queue;
static struct workqueue_struct *respond_queue;
/*
* ftdi_module_lock exists to protect access to global variables
*
*/
* ftdi_module_lock exists to protect access to global variables
*
*/
static struct mutex ftdi_module_lock;
static int ftdi_instances = 0;
static struct list_head ftdi_static_list;
/*
* end of the global variables protected by ftdi_module_lock
*/
* end of the global variables protected by ftdi_module_lock
*/
#include "usb_u132.h"
#include <asm/io.h>
#include <linux/usb/hcd.h>
/* FIXME ohci.h is ONLY for internal use by the OHCI driver.
/* FIXME ohci.h is ONLY for internal use by the OHCI driver.
* If you're going to try stuff like this, you need to split
* out shareable stuff (register declarations?) into its own
* file, maybe name <linux/usb/ohci.h>
@ -93,16 +93,16 @@ static const struct usb_device_id ftdi_elan_table[] = {
MODULE_DEVICE_TABLE(usb, ftdi_elan_table);
/* only the jtag(firmware upgrade device) interface requires
* a device file and corresponding minor number, but the
* interface is created unconditionally - I suppose it could
* be configured or not according to a module parameter.
* But since we(now) require one interface per device,
* and since it unlikely that a normal installation would
* require more than a couple of elan-ftdi devices, 8 seems
* like a reasonable limit to have here, and if someone
* really requires more than 8 devices, then they can frig the
* code and recompile
*/
* a device file and corresponding minor number, but the
* interface is created unconditionally - I suppose it could
* be configured or not according to a module parameter.
* But since we(now) require one interface per device,
* and since it unlikely that a normal installation would
* require more than a couple of elan-ftdi devices, 8 seems
* like a reasonable limit to have here, and if someone
* really requires more than 8 devices, then they can frig the
* code and recompile
*/
#define USB_FTDI_ELAN_MINOR_BASE 192
#define COMMAND_BITS 5
#define COMMAND_SIZE (1<<COMMAND_BITS)
@ -139,7 +139,7 @@ struct u132_target {
int non_null;
int active;
int abandoning;
void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
void (*callback)(void *endp, struct urb *urb, u8 *buf, int len,
int toggle_bits, int error_count, int condition_code,
int repeat_number, int halted, int skipped, int actual,
int non_null);
@ -515,10 +515,10 @@ static void ftdi_elan_respond_work(struct work_struct *work)
/*
* the sw_lock is initially held and will be freed
* after the FTDI has been synchronized
*
*/
* the sw_lock is initially held and will be freed
* after the FTDI has been synchronized
*
*/
static void ftdi_elan_status_work(struct work_struct *work)
{
struct usb_ftdi *ftdi =
@ -614,11 +614,11 @@ static void ftdi_elan_status_work(struct work_struct *work)
/*
* file_operations for the jtag interface
*
* the usage count for the device is incremented on open()
* and decremented on release()
*/
* file_operations for the jtag interface
*
* the usage count for the device is incremented on open()
* and decremented on release()
*/
static int ftdi_elan_open(struct inode *inode, struct file *file)
{
int subminor;
@ -658,10 +658,10 @@ static int ftdi_elan_release(struct inode *inode, struct file *file)
/*
*
* blocking bulk reads are used to get data from the device
*
*/
*
* blocking bulk reads are used to get data from the device
*
*/
static ssize_t ftdi_elan_read(struct file *file, char __user *buffer,
size_t count, loff_t *ppos)
{
@ -676,7 +676,7 @@ static ssize_t ftdi_elan_read(struct file *file, char __user *buffer,
return -ENODEV;
}
data[0] = 0;
have:if (ftdi->bulk_in_left > 0) {
have:if (ftdi->bulk_in_left > 0) {
if (count-- > 0) {
char *p = ++ftdi->bulk_in_last + ftdi->bulk_in_buffer;
ftdi->bulk_in_left -= 1;
@ -694,7 +694,7 @@ static ssize_t ftdi_elan_read(struct file *file, char __user *buffer,
} else
return bytes_read;
}
more:if (count > 0) {
more:if (count > 0) {
int packet_bytes = 0;
int retval = usb_bulk_msg(ftdi->udev,
usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
@ -942,13 +942,13 @@ static char *have_ed_get_response(struct usb_ftdi *ftdi,
/*
* The engine tries to empty the FTDI fifo
*
* all responses found in the fifo data are dispatched thus
* the response buffer can only ever hold a maximum sized
* response from the Uxxx.
*
*/
* The engine tries to empty the FTDI fifo
*
* all responses found in the fifo data are dispatched thus
* the response buffer can only ever hold a maximum sized
* response from the Uxxx.
*
*/
static int ftdi_elan_respond_engine(struct usb_ftdi *ftdi)
{
u8 *b = ftdi->response + ftdi->received;
@ -956,7 +956,7 @@ static int ftdi_elan_respond_engine(struct usb_ftdi *ftdi)
int retry_on_empty = 1;
int retry_on_timeout = 3;
int empty_packets = 0;
read:{
read:{
int packet_bytes = 0;
int retval = usb_bulk_msg(ftdi->udev,
usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
@ -1036,10 +1036,10 @@ static int ftdi_elan_respond_engine(struct usb_ftdi *ftdi)
return 0;
}
}
more:{
more:{
goto read;
}
have:if (ftdi->bulk_in_left > 0) {
have:if (ftdi->bulk_in_left > 0) {
u8 c = ftdi->bulk_in_buffer[++ftdi->bulk_in_last];
bytes_read += 1;
ftdi->bulk_in_left -= 1;
@ -1142,9 +1142,9 @@ static int ftdi_elan_respond_engine(struct usb_ftdi *ftdi)
/*
* create a urb, and a buffer for it, and copy the data to the urb
*
*/
* create a urb, and a buffer for it, and copy the data to the urb
*
*/
static ssize_t ftdi_elan_write(struct file *file,
const char __user *user_buffer, size_t count,
loff_t *ppos)
@ -1207,9 +1207,9 @@ static const struct file_operations ftdi_elan_fops = {
};
/*
* usb class driver info in order to get a minor number from the usb core,
* and to have the device registered with the driver core
*/
* usb class driver info in order to get a minor number from the usb core,
* and to have the device registered with the driver core
*/
static struct usb_class_driver ftdi_elan_jtag_class = {
.name = "ftdi-%d-jtag",
.fops = &ftdi_elan_fops,
@ -1217,10 +1217,10 @@ static struct usb_class_driver ftdi_elan_jtag_class = {
};
/*
* the following definitions are for the
* ELAN FPGA state machgine processor that
* lies on the other side of the FTDI chip
*/
* the following definitions are for the
* ELAN FPGA state machgine processor that
* lies on the other side of the FTDI chip
*/
#define cPCIu132rd 0x0
#define cPCIu132wr 0x1
#define cPCIiord 0x2
@ -1251,7 +1251,7 @@ static struct usb_class_driver ftdi_elan_jtag_class = {
#define cCCnotaccessed 0xF
static int ftdi_elan_write_reg(struct usb_ftdi *ftdi, u32 data)
{
wait:if (ftdi->disconnected > 0) {
wait:if (ftdi->disconnected > 0) {
return -ENODEV;
} else {
int command_size;
@ -1283,7 +1283,7 @@ static int ftdi_elan_write_config(struct usb_ftdi *ftdi, int config_offset,
u8 width, u32 data)
{
u8 addressofs = config_offset / 4;
wait:if (ftdi->disconnected > 0) {
wait:if (ftdi->disconnected > 0) {
return -ENODEV;
} else {
int command_size;
@ -1315,7 +1315,7 @@ static int ftdi_elan_write_pcimem(struct usb_ftdi *ftdi, int mem_offset,
u8 width, u32 data)
{
u8 addressofs = mem_offset / 4;
wait:if (ftdi->disconnected > 0) {
wait:if (ftdi->disconnected > 0) {
return -ENODEV;
} else {
int command_size;
@ -1354,7 +1354,7 @@ int usb_ftdi_elan_write_pcimem(struct platform_device *pdev, int mem_offset,
EXPORT_SYMBOL_GPL(usb_ftdi_elan_write_pcimem);
static int ftdi_elan_read_reg(struct usb_ftdi *ftdi, u32 *data)
{
wait:if (ftdi->disconnected > 0) {
wait:if (ftdi->disconnected > 0) {
return -ENODEV;
} else {
int command_size;
@ -1397,7 +1397,7 @@ static int ftdi_elan_read_config(struct usb_ftdi *ftdi, int config_offset,
u8 width, u32 *data)
{
u8 addressofs = config_offset / 4;
wait:if (ftdi->disconnected > 0) {
wait:if (ftdi->disconnected > 0) {
return -ENODEV;
} else {
int command_size;
@ -1441,7 +1441,7 @@ static int ftdi_elan_read_pcimem(struct usb_ftdi *ftdi, int mem_offset,
u8 width, u32 *data)
{
u8 addressofs = mem_offset / 4;
wait:if (ftdi->disconnected > 0) {
wait:if (ftdi->disconnected > 0) {
return -ENODEV;
} else {
int command_size;
@ -1500,7 +1500,7 @@ static int ftdi_elan_edset_setup(struct usb_ftdi *ftdi, u8 ed_number,
int halted, int skipped, int actual, int non_null))
{
u8 ed = ed_number - 1;
wait:if (ftdi->disconnected > 0) {
wait:if (ftdi->disconnected > 0) {
return -ENODEV;
} else if (ftdi->initialized == 0) {
return -ENODEV;
@ -1557,7 +1557,7 @@ static int ftdi_elan_edset_input(struct usb_ftdi *ftdi, u8 ed_number,
int halted, int skipped, int actual, int non_null))
{
u8 ed = ed_number - 1;
wait:if (ftdi->disconnected > 0) {
wait:if (ftdi->disconnected > 0) {
return -ENODEV;
} else if (ftdi->initialized == 0) {
return -ENODEV;
@ -1622,7 +1622,7 @@ static int ftdi_elan_edset_empty(struct usb_ftdi *ftdi, u8 ed_number,
int halted, int skipped, int actual, int non_null))
{
u8 ed = ed_number - 1;
wait:if (ftdi->disconnected > 0) {
wait:if (ftdi->disconnected > 0) {
return -ENODEV;
} else if (ftdi->initialized == 0) {
return -ENODEV;
@ -1679,7 +1679,7 @@ static int ftdi_elan_edset_output(struct usb_ftdi *ftdi, u8 ed_number,
int halted, int skipped, int actual, int non_null))
{
u8 ed = ed_number - 1;
wait:if (ftdi->disconnected > 0) {
wait:if (ftdi->disconnected > 0) {
return -ENODEV;
} else if (ftdi->initialized == 0) {
return -ENODEV;
@ -1758,7 +1758,7 @@ static int ftdi_elan_edset_single(struct usb_ftdi *ftdi, u8 ed_number,
int halted, int skipped, int actual, int non_null))
{
u8 ed = ed_number - 1;
wait:if (ftdi->disconnected > 0) {
wait:if (ftdi->disconnected > 0) {
return -ENODEV;
} else if (ftdi->initialized == 0) {
return -ENODEV;
@ -1876,7 +1876,7 @@ static int ftdi_elan_flush_input_fifo(struct usb_ftdi *ftdi)
int retry_on_empty = 10;
int retry_on_timeout = 5;
int retry_on_status = 20;
more:{
more:{
int packet_bytes = 0;
int retval = usb_bulk_msg(ftdi->udev,
usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
@ -1950,9 +1950,9 @@ static int ftdi_elan_flush_input_fifo(struct usb_ftdi *ftdi)
/*
* send the long flush sequence
*
*/
* send the long flush sequence
*
*/
static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
{
int retval;
@ -1993,9 +1993,9 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
/*
* send the reset sequence
*
*/
* send the reset sequence
*
*/
static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
{
int retval;
@ -2172,7 +2172,7 @@ static int ftdi_elan_stuck_waiting(struct usb_ftdi *ftdi)
int retry_on_empty = 10;
int retry_on_timeout = 5;
int retry_on_status = 50;
more:{
more:{
int packet_bytes = 0;
int retval = usb_bulk_msg(ftdi->udev,
usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
@ -2366,13 +2366,13 @@ static int ftdi_elan_check_controller(struct usb_ftdi *ftdi, int quirk)
retval = ftdi_read_pcimem(ftdi, control, &control);
if (retval)
return retval;
retry:retval = ftdi_read_pcimem(ftdi, cmdstatus, &status);
retry:retval = ftdi_read_pcimem(ftdi, cmdstatus, &status);
if (retval)
return retval;
retval = ftdi_write_pcimem(ftdi, cmdstatus, OHCI_HCR);
if (retval)
return retval;
extra:{
extra:{
retval = ftdi_read_pcimem(ftdi, cmdstatus, &status);
if (retval)
return retval;
@ -2744,8 +2744,8 @@ static int ftdi_elan_setupOHCI(struct usb_ftdi *ftdi)
/*
* we use only the first bulk-in and bulk-out endpoints
*/
* we use only the first bulk-in and bulk-out endpoints
*/
static int ftdi_elan_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
@ -2839,7 +2839,7 @@ static int ftdi_elan_probe(struct usb_interface *interface,
retval = -ENODEV;
goto error;
}
error:if (ftdi) {
error:if (ftdi) {
ftdi_elan_put_kref(ftdi);
}
return retval;
@ -2911,11 +2911,11 @@ static int __init ftdi_elan_init(void)
}
return result;
err_respond_queue:
err_respond_queue:
destroy_workqueue(command_queue);
err_command_queue:
err_command_queue:
destroy_workqueue(status_queue);
err_status_queue:
err_status_queue:
printk(KERN_ERR "%s couldn't create workqueue\n", ftdi_elan_driver.name);
return -ENOMEM;
}