This member of mite_struct is only used to map the mite I/O window.
For aesthetics, remove it and use a local variable instead.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int mite_setup2(struct comedi_device *dev,
struct mite_struct *mite, bool use_win1)
{
+ resource_size_t daq_phys_addr;
unsigned long length;
int i;
u32 csigr_bits;
"Failed to remap daq io memory address\n");
return -ENOMEM;
}
- mite->daq_phys_addr = pci_resource_start(mite->pcidev, 1);
+ daq_phys_addr = pci_resource_start(mite->pcidev, 1);
length = pci_resource_len(mite->pcidev, 1);
if (use_win1) {
writel(0, mite->mite_io_addr + MITE_IODWBSR);
dev_info(dev->class_dev,
"using I/O Window Base Size register 1\n");
- writel(mite->daq_phys_addr | WENAB |
+ writel(daq_phys_addr | WENAB |
MITE_IODWBSR_1_WSIZE_bits(length),
mite->mite_io_addr + MITE_IODWBSR_1);
writel(0, mite->mite_io_addr + MITE_IODWCR_1);
} else {
- writel(mite->daq_phys_addr | WENAB,
+ writel(daq_phys_addr | WENAB,
mite->mite_io_addr + MITE_IODWBSR);
}
/*
struct mite_struct {
struct pci_dev *pcidev;
void __iomem *mite_io_addr;
- resource_size_t daq_phys_addr;
struct mite_channel channels[MAX_MITE_DMA_CHANNELS];
short channel_allocated[MAX_MITE_DMA_CHANNELS];
int num_channels;
static void m_series_init_eeprom_buffer(struct comedi_device *dev)
{
struct ni_private *devpriv = dev->private;
+ resource_size_t daq_phys_addr;
static const int Start_Cal_EEPROM = 0x400;
static const unsigned window_size = 10;
static const int serial_number_eeprom_offset = 0x4;
unsigned old_iodwcr1_bits;
int i;
+ /* IO Window 1 needs to be temporarily mapped to read the eeprom */
+ daq_phys_addr = pci_resource_start(devpriv->mite->pcidev, 1);
+
old_iodwbsr_bits = readl(devpriv->mite->mite_io_addr + MITE_IODWBSR);
old_iodwbsr1_bits = readl(devpriv->mite->mite_io_addr + MITE_IODWBSR_1);
old_iodwcr1_bits = readl(devpriv->mite->mite_io_addr + MITE_IODWCR_1);
writel(0x0, devpriv->mite->mite_io_addr + MITE_IODWBSR);
- writel(((0x80 | window_size) | devpriv->mite->daq_phys_addr),
+ writel(((0x80 | window_size) | daq_phys_addr),
devpriv->mite->mite_io_addr + MITE_IODWBSR_1);
writel(0x1 | old_iodwcr1_bits,
devpriv->mite->mite_io_addr + MITE_IODWCR_1);