* pnp:
  pnp: restore automatic resolution of DMA conflicts
This commit is contained in:
Rafael J. Wysocki 2013-06-28 13:00:57 +02:00
Родитель 207bc1181b bdf0eb3a02
Коммит 3e79a8a67d
1 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -211,6 +211,12 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
res->start = -1; res->start = -1;
res->end = -1; res->end = -1;
if (!rule->map) {
res->flags |= IORESOURCE_DISABLED;
pnp_dbg(&dev->dev, " dma %d disabled\n", idx);
goto __add;
}
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
if (rule->map & (1 << xtab[i])) { if (rule->map & (1 << xtab[i])) {
res->start = res->end = xtab[i]; res->start = res->end = xtab[i];
@ -218,11 +224,9 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
goto __add; goto __add;
} }
} }
#ifdef MAX_DMA_CHANNELS
res->start = res->end = MAX_DMA_CHANNELS; pnp_dbg(&dev->dev, " couldn't assign dma %d\n", idx);
#endif return -EBUSY;
res->flags |= IORESOURCE_DISABLED;
pnp_dbg(&dev->dev, " disable dma %d\n", idx);
__add: __add:
pnp_add_dma_resource(dev, res->start, res->flags); pnp_add_dma_resource(dev, res->start, res->flags);