Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 70763
b: refs/heads/master
c: 7ef3639
h: refs/heads/master
i:
  70761: 04f8ab2
  70759: e2db253
v: v3
  • Loading branch information
Jan Beulich authored and Linus Torvalds committed Oct 17, 2007
1 parent 4046faf commit 3272b7b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 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: 36e02b62084efa72f1f04c95e13295a456f394c2
refs/heads/master: 7ef36390fabe2168fe31f245e49eb4e5f3762622
29 changes: 12 additions & 17 deletions trunk/drivers/pnp/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)
return 0;
}

static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
static void pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
{
resource_size_t *start, *end;
unsigned long *flags;
Expand All @@ -173,15 +173,14 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
};

if (idx >= PNP_MAX_DMA) {
pnp_err
("More than 2 dmas is incompatible with pnp specifications.");
/* pretend we were successful so at least the manager won't try again */
return 1;
pnp_err("More than 2 dmas is incompatible with pnp "
"specifications.");
return;
}

/* check if this resource has been manually set, if so skip */
if (!(dev->res.dma_resource[idx].flags & IORESOURCE_AUTO))
return 1;
return;

start = &dev->res.dma_resource[idx].start;
end = &dev->res.dma_resource[idx].end;
Expand All @@ -191,19 +190,17 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
*flags |= rule->flags | IORESOURCE_DMA;
*flags &= ~IORESOURCE_UNSET;

if (!rule->map) {
*flags |= IORESOURCE_DISABLED;
return 1; /* skip disabled resource requests */
}

for (i = 0; i < 8; i++) {
if (rule->map & (1 << xtab[i])) {
*start = *end = xtab[i];
if (pnp_check_dma(dev, idx))
return 1;
return;
}
}
return 0;
#ifdef MAX_DMA_CHANNELS
*start = *end = MAX_DMA_CHANNELS;
#endif
*flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED;
}

/**
Expand Down Expand Up @@ -330,8 +327,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int depnum)
irq = irq->next;
}
while (dma) {
if (!pnp_assign_dma(dev, dma, ndma))
goto fail;
pnp_assign_dma(dev, dma, ndma);
ndma++;
dma = dma->next;
}
Expand Down Expand Up @@ -367,8 +363,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int depnum)
irq = irq->next;
}
while (dma) {
if (!pnp_assign_dma(dev, dma, ndma))
goto fail;
pnp_assign_dma(dev, dma, ndma);
ndma++;
dma = dma->next;
}
Expand Down

0 comments on commit 3272b7b

Please sign in to comment.