staging: comedi: addi-data: Get rid of redundant ps_BoardInfo
The ps_BoardInfo pointer in the device private data is redundant as we can just use the this_board macro to access the same data, as is done elsewhere in the code. Get rid of the pointer and change the code to use the this_board macro instead. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
57517878df
commit
7e0b3bf3ab
@ -2666,13 +2666,11 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||||||
devpriv->i_IobaseAmcc = (int) iobase_a; /* AMCC base address... */
|
devpriv->i_IobaseAmcc = (int) iobase_a; /* AMCC base address... */
|
||||||
devpriv->i_IobaseAddon = (int) iobase_addon; /* ADD ON base address.... */
|
devpriv->i_IobaseAddon = (int) iobase_addon; /* ADD ON base address.... */
|
||||||
devpriv->i_IobaseReserved = (int) iobase_reserved;
|
devpriv->i_IobaseReserved = (int) iobase_reserved;
|
||||||
devpriv->ps_BoardInfo = this_board;
|
|
||||||
} else {
|
} else {
|
||||||
dev->board_name = this_board->pc_DriverName;
|
dev->board_name = this_board->pc_DriverName;
|
||||||
dev->iobase = (unsigned long)io_addr[2];
|
dev->iobase = (unsigned long)io_addr[2];
|
||||||
devpriv->amcc = card;
|
devpriv->amcc = card;
|
||||||
devpriv->iobase = (int) io_addr[2];
|
devpriv->iobase = (int) io_addr[2];
|
||||||
devpriv->ps_BoardInfo = this_board;
|
|
||||||
devpriv->i_IobaseReserved = (int) io_addr[3];
|
devpriv->i_IobaseReserved = (int) io_addr[3];
|
||||||
printk("\nioremap begin");
|
printk("\nioremap begin");
|
||||||
devpriv->dw_AiBase = ioremap(io_addr[3],
|
devpriv->dw_AiBase = ioremap(io_addr[3],
|
||||||
@ -2987,8 +2985,8 @@ static int i_ADDI_Detach(struct comedi_device *dev)
|
|||||||
free_irq(dev->irq, dev);
|
free_irq(dev->irq, dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((devpriv->ps_BoardInfo->pc_EepromChip == NULL)
|
if ((this_board->pc_EepromChip == NULL)
|
||||||
|| (strcmp(devpriv->ps_BoardInfo->pc_EepromChip,
|
|| (strcmp(this_board->pc_EepromChip,
|
||||||
ADDIDATA_9054) != 0)) {
|
ADDIDATA_9054) != 0)) {
|
||||||
if (devpriv->allocated) {
|
if (devpriv->allocated) {
|
||||||
i_pci_card_free(devpriv->amcc);
|
i_pci_card_free(devpriv->amcc);
|
||||||
|
@ -406,7 +406,6 @@ struct addi_private {
|
|||||||
|
|
||||||
/* Pointer to the current process */
|
/* Pointer to the current process */
|
||||||
struct task_struct *tsk_Current;
|
struct task_struct *tsk_Current;
|
||||||
const struct addi_board *ps_BoardInfo;
|
|
||||||
|
|
||||||
/* Hardware board infos for 1710 */
|
/* Hardware board infos for 1710 */
|
||||||
struct {
|
struct {
|
||||||
|
@ -97,7 +97,7 @@ int i_APCI16XX_InsnConfigInitTTLIO(struct comedi_device *dev,
|
|||||||
unsigned char b_Command = 0;
|
unsigned char b_Command = 0;
|
||||||
unsigned char b_Cpt = 0;
|
unsigned char b_Cpt = 0;
|
||||||
unsigned char b_NumberOfPort =
|
unsigned char b_NumberOfPort =
|
||||||
(unsigned char) (devpriv->ps_BoardInfo->i_NbrTTLChannel / 8);
|
(unsigned char) (this_board->i_NbrTTLChannel / 8);
|
||||||
|
|
||||||
/************************/
|
/************************/
|
||||||
/* Test the buffer size */
|
/* Test the buffer size */
|
||||||
@ -289,7 +289,7 @@ int i_APCI16XX_InsnBitsReadTTLIO(struct comedi_device *dev,
|
|||||||
int i_ReturnValue = insn->n;
|
int i_ReturnValue = insn->n;
|
||||||
unsigned char b_Command = 0;
|
unsigned char b_Command = 0;
|
||||||
unsigned char b_NumberOfPort =
|
unsigned char b_NumberOfPort =
|
||||||
(unsigned char) (devpriv->ps_BoardInfo->i_NbrTTLChannel / 8);
|
(unsigned char) (this_board->i_NbrTTLChannel / 8);
|
||||||
unsigned char b_SelectedPort = CR_RANGE(insn->chanspec);
|
unsigned char b_SelectedPort = CR_RANGE(insn->chanspec);
|
||||||
unsigned char b_InputChannel = CR_CHAN(insn->chanspec);
|
unsigned char b_InputChannel = CR_CHAN(insn->chanspec);
|
||||||
unsigned char *pb_Status;
|
unsigned char *pb_Status;
|
||||||
@ -450,9 +450,9 @@ int i_APCI16XX_InsnReadTTLIOAllPortValue(struct comedi_device *dev,
|
|||||||
/**********************************/
|
/**********************************/
|
||||||
|
|
||||||
b_NumberOfPort =
|
b_NumberOfPort =
|
||||||
(unsigned char) (devpriv->ps_BoardInfo->i_NbrTTLChannel / 32);
|
(unsigned char) (this_board->i_NbrTTLChannel / 32);
|
||||||
if ((b_NumberOfPort * 32) <
|
if ((b_NumberOfPort * 32) <
|
||||||
devpriv->ps_BoardInfo->i_NbrTTLChannel) {
|
this_board->i_NbrTTLChannel) {
|
||||||
b_NumberOfPort = b_NumberOfPort + 1;
|
b_NumberOfPort = b_NumberOfPort + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -576,7 +576,7 @@ int i_APCI16XX_InsnBitsWriteTTLIO(struct comedi_device *dev,
|
|||||||
int i_ReturnValue = insn->n;
|
int i_ReturnValue = insn->n;
|
||||||
unsigned char b_Command = 0;
|
unsigned char b_Command = 0;
|
||||||
unsigned char b_NumberOfPort =
|
unsigned char b_NumberOfPort =
|
||||||
(unsigned char) (devpriv->ps_BoardInfo->i_NbrTTLChannel / 8);
|
(unsigned char) (this_board->i_NbrTTLChannel / 8);
|
||||||
unsigned char b_SelectedPort = CR_RANGE(insn->chanspec);
|
unsigned char b_SelectedPort = CR_RANGE(insn->chanspec);
|
||||||
unsigned char b_OutputChannel = CR_CHAN(insn->chanspec);
|
unsigned char b_OutputChannel = CR_CHAN(insn->chanspec);
|
||||||
unsigned int dw_Status = 0;
|
unsigned int dw_Status = 0;
|
||||||
|
@ -141,8 +141,7 @@ static int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device *dev,
|
|||||||
/* Test the time base */
|
/* Test the time base */
|
||||||
/**********************/
|
/**********************/
|
||||||
|
|
||||||
if ((devpriv->ps_BoardInfo->
|
if ((this_board->b_AvailableConvertUnit & (1 << b_TimeBase)) !=
|
||||||
b_AvailableConvertUnit & (1 << b_TimeBase)) !=
|
|
||||||
0) {
|
0) {
|
||||||
/*******************************/
|
/*******************************/
|
||||||
/* Test the convert time value */
|
/* Test the convert time value */
|
||||||
@ -173,7 +172,7 @@ static int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device *dev,
|
|||||||
if (((b_SingleDiff == APCI3XXX_SINGLE)
|
if (((b_SingleDiff == APCI3XXX_SINGLE)
|
||||||
&& (devpriv->s_EeParameters.i_NbrAiChannel == 0))
|
&& (devpriv->s_EeParameters.i_NbrAiChannel == 0))
|
||||||
|| ((b_SingleDiff == APCI3XXX_DIFF)
|
|| ((b_SingleDiff == APCI3XXX_DIFF)
|
||||||
&& (devpriv->ps_BoardInfo->i_NbrAiChannelDiff == 0))
|
&& (this_board->i_NbrAiChannelDiff == 0))
|
||||||
) {
|
) {
|
||||||
/*******************************/
|
/*******************************/
|
||||||
/* Single/Diff selection error */
|
/* Single/Diff selection error */
|
||||||
@ -378,8 +377,7 @@ static int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device *dev,
|
|||||||
|
|
||||||
if (((b_Channel < devpriv->s_EeParameters.i_NbrAiChannel)
|
if (((b_Channel < devpriv->s_EeParameters.i_NbrAiChannel)
|
||||||
&& (devpriv->b_SingelDiff == APCI3XXX_SINGLE))
|
&& (devpriv->b_SingelDiff == APCI3XXX_SINGLE))
|
||||||
|| ((b_Channel < devpriv->ps_BoardInfo->
|
|| ((b_Channel < this_board->i_NbrAiChannelDiff)
|
||||||
i_NbrAiChannelDiff)
|
|
||||||
&& (devpriv->b_SingelDiff == APCI3XXX_DIFF))) {
|
&& (devpriv->b_SingelDiff == APCI3XXX_DIFF))) {
|
||||||
/**********************************/
|
/**********************************/
|
||||||
/* Test the channel configuration */
|
/* Test the channel configuration */
|
||||||
|
Loading…
Reference in New Issue
Block a user