Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154885
b: refs/heads/master
c: e957f60
h: refs/heads/master
i:
  154883: 6e672cf
v: v3
  • Loading branch information
Grant Grundler authored and Kyle McMartin committed Jul 3, 2009
1 parent c05ba39 commit 8fa0f94
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 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: ebc30a0f67a4d6a9470556f4311478b3b04c2b1f
refs/heads/master: e957f608f321a97a60d065bccd01949590eef52e
31 changes: 22 additions & 9 deletions trunk/drivers/parisc/lba_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,28 +980,38 @@ static void
lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
{
unsigned long bytecnt;
pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; /* PA_VIEW */
pdc_pat_cell_mod_maddr_block_t io_pdc_cell; /* IO_VIEW */
long io_count;
long status; /* PDC return status */
long pa_count;
pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell; /* PA_VIEW */
pdc_pat_cell_mod_maddr_block_t *io_pdc_cell; /* IO_VIEW */
int i;

pa_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL);
if (!pa_pdc_cell)
return;

io_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL);
if (!pa_pdc_cell) {
kfree(pa_pdc_cell);
return;
}

/* return cell module (IO view) */
status = pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index,
PA_VIEW, & pa_pdc_cell);
pa_count = pa_pdc_cell.mod[1];
PA_VIEW, pa_pdc_cell);
pa_count = pa_pdc_cell->mod[1];

status |= pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index,
IO_VIEW, &io_pdc_cell);
io_count = io_pdc_cell.mod[1];
IO_VIEW, io_pdc_cell);
io_count = io_pdc_cell->mod[1];

/* We've already done this once for device discovery...*/
if (status != PDC_OK) {
panic("pdc_pat_cell_module() call failed for LBA!\n");
}

if (PAT_GET_ENTITY(pa_pdc_cell.mod_info) != PAT_ENTITY_LBA) {
if (PAT_GET_ENTITY(pa_pdc_cell->mod_info) != PAT_ENTITY_LBA) {
panic("pdc_pat_cell_module() entity returned != PAT_ENTITY_LBA!\n");
}

Expand All @@ -1016,8 +1026,8 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
} *p, *io;
struct resource *r;

p = (void *) &(pa_pdc_cell.mod[2+i*3]);
io = (void *) &(io_pdc_cell.mod[2+i*3]);
p = (void *) &(pa_pdc_cell->mod[2+i*3]);
io = (void *) &(io_pdc_cell->mod[2+i*3]);

/* Convert the PAT range data to PCI "struct resource" */
switch(p->type & 0xff) {
Expand Down Expand Up @@ -1096,6 +1106,9 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
break;
}
}

kfree(pa_pdc_cell);
kfree(io_pdc_cell);
}
#else
/* keep compiler from complaining about missing declarations */
Expand Down

0 comments on commit 8fa0f94

Please sign in to comment.