Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337524
b: refs/heads/master
c: e864e2c
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Nov 1, 2012
1 parent a0906f7 commit 7554387
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 46 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e6fee79e0dcb4dd0c22cde52dfea633b46e6e5df
refs/heads/master: e864e2c8e87ce2d8196f5fbc30591a6ea386ee5f
29 changes: 0 additions & 29 deletions trunk/drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ struct pcilst_struct {
unsigned char pci_bus;
unsigned char pci_slot;
unsigned char pci_func;
resource_size_t io_addr[5];
unsigned int irq;
};

Expand Down Expand Up @@ -230,8 +229,6 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,

int pci_card_alloc(struct pcilst_struct *amcc, int master);
int i_pci_card_free(struct pcilst_struct *amcc);
int i_pci_card_data(struct pcilst_struct *amcc,
resource_size_t *io_addr);

/****************************************************************************/

Expand All @@ -240,7 +237,6 @@ void v_pci_card_list_init(unsigned short pci_vendor)
{
struct pci_dev *pcidev = NULL;
struct pcilst_struct *amcc, *last;
int i;
int i_Count = 0;
amcc_devices = NULL;
last = NULL;
Expand All @@ -265,12 +261,6 @@ void v_pci_card_list_init(unsigned short pci_vendor)
amcc->pci_bus = pcidev->bus->number;
amcc->pci_slot = PCI_SLOT(pcidev->devfn);
amcc->pci_func = PCI_FUNC(pcidev->devfn);
/* Note: resources may be invalid if PCI device
* not enabled, but they are corrected in
* pci_card_alloc. */
for (i = 0; i < 5; i++)
amcc->io_addr[i] =
pci_resource_start(pcidev, i);
amcc->irq = pcidev->irq;

}
Expand Down Expand Up @@ -345,18 +335,13 @@ int i_find_free_pci_card_by_position(unsigned short vendor_id,
/* mark card as used */
int pci_card_alloc(struct pcilst_struct *amcc, int master)
{
int i;

if (!amcc)
return -1;

if (amcc->used)
return 1;
if (comedi_pci_enable(amcc->pcidev, "addi_amcc_s5933"))
return -1;
/* Resources will be accurate now. */
for (i = 0; i < 5; i++)
amcc->io_addr[i] = pci_resource_start(amcc->pcidev, i);
if (master)
pci_set_master(amcc->pcidev);
amcc->used = 1;
Expand All @@ -378,20 +363,6 @@ int i_pci_card_free(struct pcilst_struct *amcc)
return 0;
}

/****************************************************************************/
/* return all card information for driver */
int i_pci_card_data(struct pcilst_struct *amcc,
resource_size_t *io_addr)
{
int i;

if (!amcc)
return -1;
for (i = 0; i < 5; i++)
io_addr[i] = amcc->io_addr[i];
return 0;
}

/****************************************************************************/
/* select and alloc card */
struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
Expand Down
26 changes: 10 additions & 16 deletions trunk/drivers/staging/comedi/drivers/addi-data/addi_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
struct comedi_subdevice *s;
int ret, pages, i, n_subdevices;
unsigned int dw_Dummy;
resource_size_t io_addr[5];
resource_size_t iobase_a, iobase_main, iobase_addon, iobase_reserved;
struct pcilst_struct *card = NULL;
int i_Dma = 0;
Expand Down Expand Up @@ -120,15 +119,10 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)

devpriv->allocated = 1;

if ((i_pci_card_data(card, &io_addr[0])) < 0) {
i_pci_card_free(card);
return -EIO;
}

iobase_a = io_addr[0];
iobase_main = io_addr[1];
iobase_addon = io_addr[2];
iobase_reserved = io_addr[3];
iobase_a = pci_resource_start(card->pcidev, 0);
iobase_main = pci_resource_start(card->pcidev, 1);
iobase_addon = pci_resource_start(card->pcidev, 2);
iobase_reserved = pci_resource_start(card->pcidev, 3);

if ((this_board->pc_EepromChip == NULL)
|| (strcmp(this_board->pc_EepromChip, ADDIDATA_9054) != 0)) {
Expand All @@ -150,11 +144,11 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
devpriv->i_IobaseReserved = (int) iobase_reserved;
} else {
dev->board_name = this_board->pc_DriverName;
dev->iobase = (unsigned long)io_addr[2];
dev->iobase = pci_resource_start(card->pcidev, 2);
devpriv->amcc = card;
devpriv->iobase = (int) io_addr[2];
devpriv->i_IobaseReserved = (int) io_addr[3];
devpriv->dw_AiBase = ioremap(io_addr[3],
devpriv->iobase = pci_resource_start(card->pcidev, 2);
devpriv->i_IobaseReserved = pci_resource_start(card->pcidev, 3);
devpriv->dw_AiBase = ioremap(pci_resource_start(card->pcidev, 3),
this_board->i_IorangeBase3);
}

Expand Down Expand Up @@ -196,7 +190,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
dw_Dummy = inl(devpriv->i_IobaseAmcc + 0x38);
outl(dw_Dummy | 0x2000, devpriv->i_IobaseAmcc + 0x38);
}
addi_eeprom_read_info(dev, io_addr[0]);
addi_eeprom_read_info(dev, pci_resource_start(card->pcidev, 0));
}

if (it->options[2] > 0) {
Expand Down Expand Up @@ -242,7 +236,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
i_ADDI_AttachPCI1710(dev);

/* save base address */
devpriv->s_BoardInfos.ui_Address = io_addr[2];
devpriv->s_BoardInfos.ui_Address = pci_resource_start(card->pcidev, 2);
#endif
} else {
n_subdevices = 7;
Expand Down

0 comments on commit 7554387

Please sign in to comment.