mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marek Belisko <marek.belisko@gmail.com>
To: Greg Kroah-Hartman <gregkh@suse.de>,
	Marek Belisko <marek.belisko@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: Marek Belisko <marek.belisko@gmail.com>
Subject: [PATCH 4/5] staging:ft1000: correct indentations for ft1000_usb.c file.
Date: Thu, 14 Oct 2010 11:40:59 +0200	[thread overview]
Message-ID: <1287049260-11988-5-git-send-email-marek.belisko@gmail.com> (raw)
In-Reply-To: <1287049260-11988-1-git-send-email-marek.belisko@gmail.com>

Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
---
 drivers/staging/ft1000/ft1000-usb/ft1000_usb.c |  165 +++++++++++------------
 1 files changed, 79 insertions(+), 86 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
index c6aec27..44c475b 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
@@ -22,17 +22,16 @@ MODULE_DESCRIPTION("FT1000 EXPRESS CARD DRIVER");
 MODULE_LICENSE("Dual MPL/GPL");
 MODULE_SUPPORTED_DEVICE("QFT FT1000 Express Cards");
 
-
 void *pFileStart;
 size_t FileLength;
 
-#define VENDOR_ID 0x1291   /* Qualcomm vendor id */
-#define PRODUCT_ID 0x11    /* fake product id */
+#define VENDOR_ID 0x1291	/* Qualcomm vendor id */
+#define PRODUCT_ID 0x11		/* fake product id */
 
 /* table of devices that work with this driver */
 static struct usb_device_id id_table[] = {
-    {USB_DEVICE(VENDOR_ID, PRODUCT_ID)},
-    { },
+	{USB_DEVICE(VENDOR_ID, PRODUCT_ID)},
+	{},
 };
 
 MODULE_DEVICE_TABLE(usb, id_table);
@@ -40,35 +39,34 @@ MODULE_DEVICE_TABLE(usb, id_table);
 static BOOLEAN gPollingfailed = FALSE;
 int ft1000_poll_thread(void *arg)
 {
-    int ret = STATUS_SUCCESS;
-
-    while (!kthread_should_stop()) {
-        msleep(10);
-        if (!gPollingfailed) {
-            ret = ft1000_poll(arg);
-            if (ret != STATUS_SUCCESS) {
-                DEBUG("ft1000_poll_thread: polling failed\n");
-                gPollingfailed = TRUE;
-            }
-        }
-    }
+	int ret = STATUS_SUCCESS;
+
+	while (!kthread_should_stop()) {
+		msleep(10);
+		if (!gPollingfailed) {
+			ret = ft1000_poll(arg);
+			if (ret != STATUS_SUCCESS) {
+				DEBUG("ft1000_poll_thread: polling failed\n");
+				gPollingfailed = TRUE;
+			}
+		}
+	}
 	return STATUS_SUCCESS;
 }
 
 static int ft1000_probe(struct usb_interface *interface,
 			const struct usb_device_id *id)
 {
-    struct usb_host_interface *iface_desc;
-    struct usb_endpoint_descriptor *endpoint;
-    struct usb_device *dev;
-    unsigned numaltsetting;
+	struct usb_host_interface *iface_desc;
+	struct usb_endpoint_descriptor *endpoint;
+	struct usb_device *dev;
+	unsigned numaltsetting;
 	int i, ret = 0, size;
 
-    struct ft1000_device *ft1000dev;
-    FT1000_INFO *pft1000info;
+	struct ft1000_device *ft1000dev;
+	FT1000_INFO *pft1000info;
 	const struct firmware *dsp_fw;
 
-
 	ft1000dev = kmalloc(sizeof(struct ft1000_device), GFP_KERNEL);
 
 	if (!ft1000dev) {
@@ -76,10 +74,10 @@ static int ft1000_probe(struct usb_interface *interface,
 		return 0;
 	}
 
-    memset(ft1000dev, 0, sizeof(*ft1000dev));
+	memset(ft1000dev, 0, sizeof(*ft1000dev));
 
-    dev = interface_to_usbdev(interface);
-    DEBUG("ft1000_probe: usb device descriptor info:\n");
+	dev = interface_to_usbdev(interface);
+	DEBUG("ft1000_probe: usb device descriptor info:\n");
 	DEBUG("ft1000_probe: number of configuration is %d\n",
 	      dev->descriptor.bNumConfigurations);
 
@@ -90,11 +88,10 @@ static int ft1000_probe(struct usb_interface *interface,
 	ft1000dev->tx_urb = usb_alloc_urb(0, GFP_ATOMIC);
 	ft1000dev->rx_urb = usb_alloc_urb(0, GFP_ATOMIC);
 
-
-    DEBUG("ft1000_probe is called\n");
-    numaltsetting = interface->num_altsetting;
-    DEBUG("ft1000_probe: number of alt settings is :%d\n", numaltsetting);
-    iface_desc = interface->cur_altsetting;
+	DEBUG("ft1000_probe is called\n");
+	numaltsetting = interface->num_altsetting;
+	DEBUG("ft1000_probe: number of alt settings is :%d\n", numaltsetting);
+	iface_desc = interface->cur_altsetting;
 	DEBUG("ft1000_probe: number of endpoints is %d\n",
 	      iface_desc->desc.bNumEndpoints);
 	DEBUG("ft1000_probe: descriptor type is %d\n",
@@ -105,7 +102,7 @@ static int ft1000_probe(struct usb_interface *interface,
 	      iface_desc->desc.bAlternateSetting);
 	DEBUG("ft1000_probe: interface class is %d\n",
 	      iface_desc->desc.bInterfaceClass);
-    DEBUG("ft1000_probe: control endpoint info:\n");
+	DEBUG("ft1000_probe: control endpoint info:\n");
 	DEBUG("ft1000_probe: descriptor0 type -- %d\n",
 	      iface_desc->endpoint[0].desc.bmAttributes);
 	DEBUG("ft1000_probe: descriptor1 type -- %d\n",
@@ -113,18 +110,18 @@ static int ft1000_probe(struct usb_interface *interface,
 	DEBUG("ft1000_probe: descriptor2 type -- %d\n",
 	      iface_desc->endpoint[2].desc.bmAttributes);
 
-    for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
+	for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
 		endpoint =
-		    (struct usb_endpoint_descriptor *)&iface_desc->endpoint[i].
-		    desc;
-                DEBUG("endpoint %d\n", i);
+		    (struct usb_endpoint_descriptor *)&iface_desc->
+		    endpoint[i].desc;
+		DEBUG("endpoint %d\n", i);
 		DEBUG("bEndpointAddress=%x, bmAttributes=%x\n",
 		      endpoint->bEndpointAddress, endpoint->bmAttributes);
 		if ((endpoint->bEndpointAddress & USB_DIR_IN)
 		    && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
 			USB_ENDPOINT_XFER_BULK)) {
 			ft1000dev->bulk_in_endpointAddr =
-				endpoint->bEndpointAddress;
+			    endpoint->bEndpointAddress;
 			DEBUG("ft1000_probe: in: %d\n",
 			      endpoint->bEndpointAddress);
 		}
@@ -133,11 +130,11 @@ static int ft1000_probe(struct usb_interface *interface,
 		    && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
 			USB_ENDPOINT_XFER_BULK)) {
 			ft1000dev->bulk_out_endpointAddr =
-				endpoint->bEndpointAddress;
+			    endpoint->bEndpointAddress;
 			DEBUG("ft1000_probe: out: %d\n",
 			      endpoint->bEndpointAddress);
 		}
-    }
+	}
 
 	DEBUG("bulk_in=%d, bulk_out=%d\n", ft1000dev->bulk_in_endpointAddr,
 	      ft1000dev->bulk_out_endpointAddr);
@@ -161,9 +158,9 @@ static int ft1000_probe(struct usb_interface *interface,
 	FileLength = dsp_fw->size;
 	release_firmware(dsp_fw);
 
-    DEBUG("ft1000_probe: start downloading dsp image...\n");
-    init_ft1000_netdev(ft1000dev);
-    pft1000info = (FT1000_INFO *) netdev_priv(ft1000dev->net);
+	DEBUG("ft1000_probe: start downloading dsp image...\n");
+	init_ft1000_netdev(ft1000dev);
+	pft1000info = (FT1000_INFO *) netdev_priv(ft1000dev->net);
 
 	DEBUG("In probe: pft1000info=%p\n", pft1000info);
 	ret = dsp_reload(ft1000dev);
@@ -188,16 +185,15 @@ static int ft1000_probe(struct usb_interface *interface,
 		DEBUG("ft1000_probe::Waiting for Card Ready\n");
 	}
 
+	DEBUG("ft1000_probe::Card Ready!!!! Registering network device\n");
 
-    DEBUG("ft1000_probe::Card Ready!!!! Registering network device\n");
-
-    reg_ft1000_netdev(ft1000dev, interface);
+	reg_ft1000_netdev(ft1000dev, interface);
 
-    pft1000info->NetDevRegDone = 1;
+	pft1000info->NetDevRegDone = 1;
 
-		ft1000InitProc(ft1000dev->net);
+	ft1000InitProc(ft1000dev->net);
 
-       return 0;
+	return 0;
 
 err_load:
 	kfree(pFileStart);
@@ -208,70 +204,67 @@ err_fw:
 
 static void ft1000_disconnect(struct usb_interface *interface)
 {
-    FT1000_INFO *pft1000info;
+	FT1000_INFO *pft1000info;
 
-    DEBUG("ft1000_disconnect is called\n");
+	DEBUG("ft1000_disconnect is called\n");
 
-    pft1000info = (PFT1000_INFO)usb_get_intfdata(interface);
+	pft1000info = (PFT1000_INFO) usb_get_intfdata(interface);
 	DEBUG("In disconnect pft1000info=%p\n", pft1000info);
 
-
-
-    if (pft1000info) {
+	if (pft1000info) {
 		ft1000CleanupProc(pft1000info);
-        if (pft1000info->pPollThread)
-            kthread_stop(pft1000info->pPollThread );
+		if (pft1000info->pPollThread)
+			kthread_stop(pft1000info->pPollThread);
 
-        DEBUG("ft1000_disconnect: threads are terminated\n");
+		DEBUG("ft1000_disconnect: threads are terminated\n");
 
-        if (pft1000info->pFt1000Dev->net) {
-            DEBUG("ft1000_disconnect: destroy char driver\n");
-            ft1000_DestroyDevice(pft1000info->pFt1000Dev->net);
-            unregister_netdev(pft1000info->pFt1000Dev->net);
-            DEBUG("ft1000_disconnect: network device unregisterd\n");
-            free_netdev(pft1000info->pFt1000Dev->net);
+		if (pft1000info->pFt1000Dev->net) {
+			DEBUG("ft1000_disconnect: destroy char driver\n");
+			ft1000_DestroyDevice(pft1000info->pFt1000Dev->net);
+			unregister_netdev(pft1000info->pFt1000Dev->net);
+			DEBUG
+			    ("ft1000_disconnect: network device unregisterd\n");
+			free_netdev(pft1000info->pFt1000Dev->net);
 
-        }
+		}
 
-        usb_free_urb(pft1000info->pFt1000Dev->rx_urb);
-        usb_free_urb(pft1000info->pFt1000Dev->tx_urb);
+		usb_free_urb(pft1000info->pFt1000Dev->rx_urb);
+		usb_free_urb(pft1000info->pFt1000Dev->tx_urb);
 
-        DEBUG("ft1000_disconnect: urb freed\n");
+		DEBUG("ft1000_disconnect: urb freed\n");
 
 		kfree(pft1000info->pFt1000Dev);
-    }
+	}
 	kfree(pFileStart);
 
-    return;
+	return;
 }
 
 static struct usb_driver ft1000_usb_driver = {
-    .name  =    "ft1000usb",
-    .probe =    ft1000_probe,
-    .disconnect = ft1000_disconnect,
-    .id_table = id_table,
+	.name = "ft1000usb",
+	.probe = ft1000_probe,
+	.disconnect = ft1000_disconnect,
+	.id_table = id_table,
 };
 
 static int __init usb_ft1000_init(void)
 {
-    int ret = 0;
+	int ret = 0;
 
-    DEBUG("Initialize and register the driver\n");
+	DEBUG("Initialize and register the driver\n");
 
-    ret = usb_register(&ft1000_usb_driver);
-    if (ret)
-        err("usb_register failed. Error number %d", ret);
+	ret = usb_register(&ft1000_usb_driver);
+	if (ret)
+		err("usb_register failed. Error number %d", ret);
 
-    return ret;
+	return ret;
 }
 
 static void __exit usb_ft1000_exit(void)
 {
-    DEBUG("Deregister the driver\n");
-    usb_deregister(&ft1000_usb_driver);
+	DEBUG("Deregister the driver\n");
+	usb_deregister(&ft1000_usb_driver);
 }
 
-module_init (usb_ft1000_init);
-module_exit (usb_ft1000_exit);
-
-
+module_init(usb_ft1000_init);
+module_exit(usb_ft1000_exit);
-- 
1.7.1


  parent reply	other threads:[~2010-10-14  9:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14  9:40 [PATCH 0/5]staging:ft1000:various code cleanup Marek Belisko
2010-10-14  9:40 ` [PATCH 1/5] staging:ft1000: various checkpatch.pl fixes Marek Belisko
2010-10-14  9:40 ` [PATCH 2/5] staging:ft1000: lines over 80 characters corrected Marek Belisko
2010-10-14  9:40 ` [PATCH 3/5] staging:ft1000: replace and remove c99 comments Marek Belisko
2010-10-14  9:40 ` Marek Belisko [this message]
2010-10-14  9:41 ` [PATCH 5/5] staging:ft1000: remove dead code Marek Belisko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1287049260-11988-5-git-send-email-marek.belisko@gmail.com \
    --to=marek.belisko@gmail.com \
    --cc=arnd@arndb.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®