logo       

[patch 01/19] chardev: pc8736x_gpio - whitespace pre-cleaning prepwork: msg#00010

Subject: [patch 01/19] chardev: pc8736x_gpio - whitespace pre-cleaning prepwork
GPIO SUPPORT FOR SCx200 & PC8736x

This patch-set reworks the 2.4 vintage scx200_gpio driver for modern
2.6, and refactors GPIO support to reuse it in a new driver for the
GPIO on PC-8736x chips.


01/19. patch.white-preclean:

Used scripts/Lindent to clean up whitespace.

Signed-off-by:  Jim Cromie <jim.cromie@xxxxxxxxx>

diffstat patch.white-preclean:
scx200_gpio.c |   44 ++++++++++++++++++++++----------------------
1 files changed, 22 insertions(+), 22 deletions(-)

diff -ruNp -X dontdiff -X exclude-diffs k16r-0/drivers/char/scx200_gpio.c 
k16r-1/drivers/char/scx200_gpio.c
--- k16r-0/drivers/char/scx200_gpio.c   2006-03-19 22:53:29.000000000 -0700
+++ k16r-1/drivers/char/scx200_gpio.c   2006-05-28 12:18:24.000000000 -0600
@@ -1,4 +1,4 @@
-/* linux/drivers/char/scx200_gpio.c +/* linux/drivers/char/scx200_gpio.c

   National Semiconductor SCx200 GPIO driver.  Allows a user space
   process to play with the GPIO pins.
@@ -26,23 +26,22 @@ static int major = 0;               /* default to dyn
module_param(major, int, 0);
MODULE_PARM_DESC(major, "Major device number");

-static ssize_t scx200_gpio_write(struct file *file, const char __user *data, - size_t len, loff_t *ppos)
+static ssize_t scx200_gpio_write(struct file *file, const char __user * data,
+                                size_t len, loff_t * ppos)
{
        unsigned m = iminor(file->f_dentry->d_inode);
        size_t i;

        for (i = 0; i < len; ++i) {
                char c;
-               if (get_user(c, data+i))
+               if (get_user(c, data + i))
                        return -EFAULT;
-               switch (c)
-               {
- case '0': - scx200_gpio_set(m, 0); + switch (c) {
+               case '0':
+                       scx200_gpio_set(m, 0);
                        break;
- case '1': - scx200_gpio_set(m, 1); + case '1':
+                       scx200_gpio_set(m, 1);
                        break;
                case 'O':
                        printk(KERN_INFO NAME ": GPIO%d output enabled\n", m);
@@ -53,11 +52,13 @@ static ssize_t scx200_gpio_write(struct scx200_gpio_configure(m, ~1, 0);
                        break;
                case 'T':
-                       printk(KERN_INFO NAME ": GPIO%d output is push pull\n", 
m);
+                       printk(KERN_INFO NAME ": GPIO%d output is push pull\n",
+                              m);
                        scx200_gpio_configure(m, ~2, 2);
                        break;
                case 't':
-                       printk(KERN_INFO NAME ": GPIO%d output is open 
drain\n", m);
+                       printk(KERN_INFO NAME ": GPIO%d output is open drain\n",
+                              m);
                        scx200_gpio_configure(m, ~2, 0);
                        break;
                case 'P':
@@ -74,8 +75,8 @@ static ssize_t scx200_gpio_write(struct return len;
}

-static ssize_t scx200_gpio_read(struct file *file, char __user *buf,
-                               size_t len, loff_t *ppos)
+static ssize_t scx200_gpio_read(struct file *file, char __user * buf,
+                               size_t len, loff_t * ppos)
{
        unsigned m = iminor(file->f_dentry->d_inode);
        int value;
@@ -83,7 +84,7 @@ static ssize_t scx200_gpio_read(struct f
        value = scx200_gpio_get(m);
        if (put_user(value ? '1' : '0', buf))
                return -EFAULT;
-       
+
        return 1;
}

@@ -100,12 +101,11 @@ static int scx200_gpio_release(struct in
        return 0;
}

-
static struct file_operations scx200_gpio_fops = {
-       .owner   = THIS_MODULE,
-       .write   = scx200_gpio_write,
-       .read    = scx200_gpio_read,
-       .open    = scx200_gpio_open,
+       .owner = THIS_MODULE,
+       .write = scx200_gpio_write,
+       .read = scx200_gpio_read,
+       .open = scx200_gpio_open,
        .release = scx200_gpio_release,
};

@@ -143,7 +143,7 @@ module_exit(scx200_gpio_cleanup);

/*
    Local variables:
-        compile-command: "make -k -C ../.. SUBDIRS=drivers/char modules"
-        c-basic-offset: 8
+       compile-command: "make -k -C ../.. SUBDIRS=drivers/char modules"
+       c-basic-offset: 8
    End:
*/


<Prev in Thread] Current Thread [Next in Thread>