]> Pileus Git - ~andy/linux/commit
staging: comedi: addi-data: Don't overwrite read-only data
authorIan Abbott <abbotti@mev.co.uk>
Mon, 16 May 2011 14:28:15 +0000 (15:28 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 May 2011 20:33:39 +0000 (13:33 -0700)
commit57517878df4e5769885e80aba895f4e69b1ddbe9
tree348372aa2f80ee76fe33b021d40397d56bb01529
parentcfe3cffd8e44c0b69c9c50a1659acbd32ac19b70
staging: comedi: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/drivers/addi-data/addi_common.c
drivers/staging/comedi/drivers/addi-data/addi_common.h
drivers/staging/comedi/drivers/addi-data/addi_eeprom.c
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c