From: Ian Abbott Date: Tue, 8 Oct 2013 18:06:30 +0000 (+0100) Subject: staging: comedi: s626: remove encpriv macro X-Git-Tag: omap-for-v3.13/fixes-for-merge-window-take2~62^2~354 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a305a66bb11dca492701db9aa9a48de4e29193e;p=pandora-kernel.git 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 Reviewed-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed