addi_data: Don't overwrite read-only data
authorIan Abbott <abbotti@mev.co.uk>
Mon, 16 May 2011 14:57:24 +0000 (15:57 +0100)
committerIan Abbott <abbotti@mev.co.uk>
Mon, 16 May 2011 14:57:24 +0000 (15:57 +0100)
commit21cc86f936e2d0a8f166d8d6c77c6a46263d22c8
treeec8e04b92fd9b64e950c4976a74b28c83f60ed76
parenteba4602b8a3e9a1113c75c6c66544b8ca6b2f188
addi_data: Don't overwrite read-only data

The drivers for ADDI-DATA cards can override some static parameters for
the board type using information read from EEPROM.  Unfortunately, they
currently write the parameters from the EEPROM back to the shared,
read-only board data!  The problem has been masked during compilation by
type-casting away the const-ness of the data.

This patch changes the code to use an area in the private data for the
board instance to hold the parameters read from EEPROM (after
initializing the parameters from the static board data).  It also
changes the type-casts to the read-only data to preserve the const
qualifier.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
comedi/drivers/addi-data/addi_common.c
comedi/drivers/addi-data/addi_common.h
comedi/drivers/addi-data/addi_eeprom.c
comedi/drivers/addi-data/hwdrv_apci3120.c
comedi/drivers/addi-data/hwdrv_apci3xxx.c