staging: comedi: ni_tio: tidy up struct ni_gpct_device (*{write, read}_register)
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 23 Mar 2016 22:36:45 +0000 (15:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
For aesthetics, rename these callbacks to simply read/write. Change the
'unsigned' parameters to 'unsigned int'.

This fixes a number of checkpatch.pl issues:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_tio.c
drivers/staging/comedi/drivers/ni_tio.h

index a225279cb83f99e74121640dee52d0e581272ada..28bec3cfeef52a243bfe53273098c1fb718566c5 100644 (file)
@@ -189,7 +189,7 @@ void ni_tio_write(struct ni_gpct *counter, unsigned int value,
                  enum ni_gpct_register reg)
 {
        if (reg < NITIO_NUM_REGS)
-               counter->counter_dev->write_register(counter, value, reg);
+               counter->counter_dev->write(counter, value, reg);
 }
 EXPORT_SYMBOL_GPL(ni_tio_write);
 
@@ -201,7 +201,7 @@ EXPORT_SYMBOL_GPL(ni_tio_write);
 unsigned int ni_tio_read(struct ni_gpct *counter, enum ni_gpct_register reg)
 {
        if (reg < NITIO_NUM_REGS)
-               return counter->counter_dev->read_register(counter, reg);
+               return counter->counter_dev->read(counter, reg);
        return 0;
 }
 EXPORT_SYMBOL_GPL(ni_tio_read);
@@ -1455,17 +1455,17 @@ EXPORT_SYMBOL_GPL(ni_tio_init_counter);
 
 struct ni_gpct_device *
 ni_gpct_device_construct(struct comedi_device *dev,
-                        void (*write_register)(struct ni_gpct *counter,
-                                               unsigned bits,
-                                               enum ni_gpct_register reg),
-                        unsigned (*read_register)(struct ni_gpct *counter,
-                                                  enum ni_gpct_register reg),
+                        void (*write)(struct ni_gpct *counter,
+                                      unsigned int value,
+                                      enum ni_gpct_register reg),
+                        unsigned int (*read)(struct ni_gpct *counter,
+                                             enum ni_gpct_register reg),
                         enum ni_gpct_variant variant,
-                        unsigned num_counters)
+                        unsigned int num_counters)
 {
        struct ni_gpct_device *counter_dev;
        struct ni_gpct *counter;
-       unsigned i;
+       unsigned int i;
 
        if (num_counters == 0)
                return NULL;
@@ -1475,8 +1475,8 @@ ni_gpct_device_construct(struct comedi_device *dev,
                return NULL;
 
        counter_dev->dev = dev;
-       counter_dev->write_register = write_register;
-       counter_dev->read_register = read_register;
+       counter_dev->write = write;
+       counter_dev->read = read;
        counter_dev->variant = variant;
 
        spin_lock_init(&counter_dev->regs_lock);
index 25aedd0e586781367a59739e75200cc9e271c9f1..63cec3edcfd42b3f3d82dcd085db89c321161ac3 100644 (file)
@@ -115,10 +115,9 @@ struct ni_gpct {
 
 struct ni_gpct_device {
        struct comedi_device *dev;
-       void (*write_register)(struct ni_gpct *counter, unsigned bits,
-                              enum ni_gpct_register reg);
-       unsigned (*read_register)(struct ni_gpct *counter,
-                                 enum ni_gpct_register reg);
+       void (*write)(struct ni_gpct *, unsigned int value,
+                     enum ni_gpct_register);
+       unsigned int (*read)(struct ni_gpct *, enum ni_gpct_register);
        enum ni_gpct_variant variant;
        struct ni_gpct *counters;
        unsigned num_counters;
@@ -128,13 +127,13 @@ struct ni_gpct_device {
 
 struct ni_gpct_device *
 ni_gpct_device_construct(struct comedi_device *,
-                        void (*write_register)(struct ni_gpct *,
-                                               unsigned bits,
-                                               enum ni_gpct_register),
-                        unsigned (*read_register)(struct ni_gpct *,
-                                                  enum ni_gpct_register),
+                        void (*write)(struct ni_gpct *,
+                                      unsigned int value,
+                                      enum ni_gpct_register),
+                        unsigned int (*read)(struct ni_gpct *,
+                                             enum ni_gpct_register),
                         enum ni_gpct_variant,
-                        unsigned num_counters);
+                        unsigned int num_counters);
 void ni_gpct_device_destroy(struct ni_gpct_device *);
 void ni_tio_init_counter(struct ni_gpct *);
 int ni_tio_insn_read(struct comedi_device *, struct comedi_subdevice *,