lkml.org 
[lkml]   [2014]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 3/6] staging: comedi: addi_apci_1564: introduce apci1564_private struct
Date
On Thursday, May 29, 2014 9:43 PM, Chase Southwood wrote:
> The addi_private struct defined in addi-data/addi_common.h is very bloated
> and contains many fields which addi_apci_1564 does not require. In the
> interest of eventually removing this driver's dependency on
> addi_common.h, we can create a private data struct specifically for
> addi_apci_1564 containing only the fields it will actually use.
>
> Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
> Cc: Ian Abbott <abbotti@mev.co.uk>
> Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
> ---
> .../comedi/drivers/addi-data/hwdrv_apci1564.c | 164 +++++++++++----------
> drivers/staging/comedi/drivers/addi_apci_1564.c | 34 ++---
> 2 files changed, 102 insertions(+), 96 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c
> index f974bd2..054e731 100644
> --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c
> +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c
> @@ -49,7 +49,7 @@
> #define APCI1564_COUNTER4 3
>
> /*
> - * devpriv->i_IobaseAmcc Register Map
> + * devpriv->amcc_iobase Register Map
> */
> #define APCI1564_DI_REG 0x04
> #define APCI1564_DI_INT_MODE1_REG 0x08
> @@ -93,6 +93,12 @@
> static unsigned int ui_InterruptStatus_1564;
> static unsigned int ui_InterruptData, ui_Type;

These static variables could also go into the new private data struct.
But, hopefully you will be removing them eventually anyway.

>
> +struct apci1564_private {
> + unsigned int amcc_iobase; /* base of AMCC I/O registers */
> + unsigned char timer_select_mode;
> + unsigned char mode_select_register;
> +};
> +

The new private data struct should really be defined in the driver (addi_apci_1564.c)
before the include of hwdrv_apci1564.c . Then you don't have to move it later.

Other than that:

Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>



\
 
 \ /
  Last update: 2014-05-30 19:21    [W:0.122 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site