[haiku-commits] r34914 - haiku/trunk/src/add-ons/kernel/drivers/input/wacom

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 6 Jan 2010 01:48:13 +0100 (CET)

Author: mmlr
Date: 2010-01-06 01:48:13 +0100 (Wed, 06 Jan 2010)
New Revision: 34914
Changeset: http://dev.haiku-os.org/changeset/34914/haiku

Modified:
   haiku/trunk/src/add-ons/kernel/drivers/input/wacom/wacom.c
Log:
Whitespace cleanup only, no functional change.


Modified: haiku/trunk/src/add-ons/kernel/drivers/input/wacom/wacom.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/input/wacom/wacom.c  2010-01-05 
22:04:24 UTC (rev 34913)
+++ haiku/trunk/src/add-ons/kernel/drivers/input/wacom/wacom.c  2010-01-06 
00:48:13 UTC (rev 34914)
@@ -73,18 +73,18 @@
 static uint32 sDeviceNumbers = 0;
 
 // get_number
-static int 
+static int
 get_number()
 {
        int num;
-       
+
        for (num = 0; num < 32; num++) {
                if (!(sDeviceNumbers & (1 << num))) {
                        sDeviceNumbers |= (1 << num);
                        return num;
                }
        }
-       
+
        return -1;
 }
 
@@ -102,7 +102,7 @@
 // and device_removed() which are invoked by the USB bus manager.
 
 // add_device
-static wacom_device* 
+static wacom_device*
 add_device(usb_device dev)
 {
        wacom_device *device = NULL;
@@ -121,7 +121,7 @@
 
        conf = usb->get_configuration(dev);
        DPRINTF_INFO((ID "add_device(%ld, %p)\n", dev, conf));
-       
+
        if ((num = get_number()) < 0)
                return NULL;
 
@@ -174,7 +174,7 @@
 got_one:
        if ((device = (wacom_device *) malloc(sizeof(wacom_device))) == NULL)
                goto fail;
-       
+
        device->dev = dev;
        device->number = num;
        device->open = 1;
@@ -206,7 +206,7 @@
                if (udd->vendor_id == 0x056a) {
                        // do the control transfers to set up absolute mode 
(default is HID
                        // mode)
-                       
+
                        // see 'Device Class Definition for HID 1.11' 
(HID1_11.pdf),
                        // par. 7.2 (available at 
www.usb.org/developers/hidpage)
 
@@ -233,34 +233,34 @@
                                // Interface #0 (=0) to repData (== { 0x02, 
0x02 })
                                st = usb->send_request(dev, 0x21, 0x09, (3 << 
8) + 2, 0, 2,
                                        repData, &controlTransferLength);
-       
+
                                if (st < B_OK) {
                                        dprintf(ID "add_device() - control 
transfer 2 failed: %ld\
                                                \n", st);
                                }
-       
+
                                // check if registers are set correctly
-       
+
                                // HID Class-Specific Request, Device to host 
(=0xA1):
                                // GET_REPORT (=0x01) type Feature (=3) with ID 
2 (=2) of
                                // Interface #0 (=0) to retData
                                st = usb->send_request(dev, 0xA1, 0x01, (3 << 
8) + 2, 0, 2,
                                        retData, &controlTransferLength);
-       
+
                                if (st < B_OK) {
                                        dprintf(ID "add_device() - control 
transfer 3 failed: %ld\
                                                \n", st);
                                }
-       
+
                                dprintf(ID "retData: %u - %u\n", retData[0], 
retData[1]);
                                
dprintf("====================================\n");
-                               
+
                                if (retData[0] == repData[0] && retData[1] == 
repData[1]) break;
-                               
+
                        }
 
                        dprintf(ID "count: %u\n", i);
-                       
+
                        if (i > 4) {
                                dprintf(ID "add_device() - set 'Wacom'-mode 
failed\n");
                        }
@@ -283,19 +283,19 @@
 
        DPRINTF_INFO((ID "add_device() - added %p (/dev/%s%d)\n", device,
                kBasePublishPath, num));
-       
+
        // add it to the list of devices so it will be published, etc
        acquire_sem(sDeviceListLock);
        device->next = sDeviceList;
        sDeviceList = device;
        sDeviceCount++;
        release_sem(sDeviceListLock);
-       
+
        return device;
 }
 
 // remove_device
-static void 
+static void
 remove_device(wacom_device *device)
 {
        put_number(device->number);
@@ -309,7 +309,7 @@
 }
 
 // device_added
-static status_t 
+static status_t
 device_added(usb_device dev, void** cookie)
 {
        wacom_device* device;
@@ -340,7 +340,7 @@
 }
 
 // device_removed
-static status_t 
+static status_t
 device_removed(void *cookie)
 {
        wacom_device *device = (wacom_device *) cookie;
@@ -348,9 +348,9 @@
        DPRINTF_INFO((ID "device_removed(%p)\n", device));
 
        if (device) {
-               
+
                acquire_sem(sDeviceListLock);
-       
+
                // remove it from the list of devices
                if (device == sDeviceList) {
                        sDeviceList = device->next;
@@ -364,10 +364,10 @@
                        }
                }
                sDeviceCount--;
-               
-               // tear it down if it's not open -- 
+
+               // tear it down if it's not open --
                // otherwise the last device_free() will handle it
-               
+
                device->open--;
 
                DPRINTF_ERR((ID "device_removed() open: %d\n", device->open));
@@ -378,7 +378,7 @@
                        dprintf(ID "device /dev/%s%d still open -- marked for 
removal\n",
                                kBasePublishPath, device->number);
                }
-               
+
                release_sem(sDeviceListLock);
        }
 
@@ -392,7 +392,7 @@
 // device_open
 static status_t
 device_open(const char *dname, uint32 flags, void** cookie)
-{      
+{
        wacom_device *device;
        int n;
        status_t ret = B_ERROR;
@@ -404,7 +404,7 @@
                return B_ERROR;
        }
 
-       n = atoi(dname + strlen(kBasePublishPath)); 
+       n = atoi(dname + strlen(kBasePublishPath));
 
        DPRINTF_INFO((ID "device_open(\"%s\",%d,...)\n", dname, flags));
 
@@ -413,7 +413,7 @@
                if (device->number == n) {
 //                     if (device->open <= 1) {
                                device->open++;
-                               *cookie = device;       
+                               *cookie = device;
                                DPRINTF_ERR((ID "device_open() open: %d\n", 
device->open));
 
                                if (device->notify_lock < 0) {
@@ -458,10 +458,10 @@
 device_free(void *cookie)
 {
        wacom_device *device = (wacom_device *)cookie;
-       
+
        DPRINTF_INFO((ID "device_free() name = \"%s%d\"\n", kBasePublishPath,
                device->number));
-       
+
        acquire_sem(sDeviceListLock);
 
        device->open--;
@@ -619,7 +619,7 @@
 // the driver and also handle registering with the USB bus manager
 // to receive device added and removed events
 
-static usb_notify_hooks notify_hooks = 
+static usb_notify_hooks notify_hooks =
 {
        &device_added,
        &device_removed
@@ -631,7 +631,7 @@
 };
 
 // init_hardware
-status_t 
+status_t
 init_hardware(void)
 {
        return B_OK;
@@ -654,7 +654,7 @@
        if (get_module(B_USB_MODULE_NAME, (module_info**) &usb) != B_OK) {
                DPRINTF_ERR((ID "cannot get module \"%s\"\n", 
B_USB_MODULE_NAME));
                return B_ERROR;
-       } 
+       }
 
        if ((sDeviceListLock = create_sem(1,"sDeviceListLock")) < 0) {
                put_module(B_USB_MODULE_NAME);
@@ -672,11 +672,11 @@
 uninit_driver(void)
 {
        int i;
-       
+
        DPRINTF_INFO((ID "uninit_driver()\n"));
-       
+
        usb->uninstall_notify(kDriverName);
-       
+
        delete_sem(sDeviceListLock);
 
        put_module(B_USB_MODULE_NAME);
@@ -686,7 +686,7 @@
                        free(sDeviceNames[i]);
                free(sDeviceNames);
        }
-       
+
        DPRINTF_INFO((ID "uninit_driver() done\n"));
 }
 
@@ -696,16 +696,16 @@
 {
        wacom_device *device;
        int i;
-       
+
        DPRINTF_INFO((ID "publish_devices()\n"));
-       
+
        if (sDeviceNames) {
                for (i = 0; sDeviceNames[i]; i++)
                        free((char *) sDeviceNames[i]);
                free(sDeviceNames);
        }
 
-       acquire_sem(sDeviceListLock);   
+       acquire_sem(sDeviceListLock);
        sDeviceNames = (char**)malloc(sizeof(char*) * (sDeviceCount + 2));
        if (sDeviceNames) {
                for (i = 0, device = sDeviceList; device; device = 
device->next) {
@@ -720,22 +720,22 @@
                sDeviceNames[i] = (char*)malloc(strlen(kBasePublishPath) + 8);
                if (sDeviceNames[i])
                        sprintf(sDeviceNames[i], "%s%s", kBasePublishPath, 
"control");
-       
+
                sDeviceNames[i + 1] = NULL;
        }
 
        release_sem(sDeviceListLock);
-       
+
        return (const char**)sDeviceNames;
 }
 
 static device_hooks sDeviceHooks = {
-       device_open,                    
-       device_close,                   
-       device_free,                    
-       device_control,                 
-       device_read,                    
-       device_write                     
+       device_open,
+       device_close,
+       device_free,
+       device_control,
+       device_read,
+       device_write
 };
 
 // find_device


Other related posts:

  • » [haiku-commits] r34914 - haiku/trunk/src/add-ons/kernel/drivers/input/wacom - mmlr