RE: [PATCH 3/6] staging: comedi: addi_apci_1564: introduce apci1564_private struct

From: Hartley Sweeten
Date: Fri May 30 2014 - 12:44:48 EST


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@xxxxxxxxx>
> Cc: Ian Abbott <abbotti@xxxxxxxxx>
> Cc: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
> ---
> .../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@xxxxxxxxxxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/