diff options
| author | Ian Abbott <abbotti@mev.co.uk> | 2013-10-08 19:06:30 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-11 15:34:20 -0700 |
| commit | 3a305a66bb11dca492701db9aa9a48de4e29193e (patch) | |
| tree | b90e983c7697f11114da8baae27e0eaa04fa2cc1 /tools | |
| parent | f1f7efce3b875126a817b8d6c0a49a4a025831a3 (diff) | |
staging: comedi: s626: remove encpriv macro
The `encpriv` macro relies on a local variable `dev` (of type `struct
comedi_device *`) being set correctly. By a convoluted path involving
the `private` data pointer of subdevice 5 (the encoder (counter)
subdevice), the macro always yields a pointer to the first element of
the static array `enc_private_data[]`. That holds statically constant
data for each of 6 encoder channels.
Instead of using the `encpriv` macro, just access the array it points to
directly and get rid of the macro. Don't bother initializing the
`private` member of the encoder subdevice any more. Since
`enc_private_data[]` now has nothing to so with subdevice private data,
rename `enc_private_data[]` to `s626_enc_chan_info[]` and rename its
type from `struct enc_private` to `struct s626_enc_info`. Since the
array contains unchanging, static information, declare it `const` and
declare all the variables that point to it `const`.
A forward declaration of `s626_enc_chan_info[]` has been added
temporarily and will be removed by a later patch.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions
