diff options
Diffstat (limited to 'drivers/pnp/manager.c')
-rw-r--r-- | drivers/pnp/manager.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index 95cebf0185de..9357aa779048 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c | |||
@@ -211,6 +211,12 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx) | |||
211 | res->start = -1; | 211 | res->start = -1; |
212 | res->end = -1; | 212 | res->end = -1; |
213 | 213 | ||
214 | if (!rule->map) { | ||
215 | res->flags |= IORESOURCE_DISABLED; | ||
216 | pnp_dbg(&dev->dev, " dma %d disabled\n", idx); | ||
217 | goto __add; | ||
218 | } | ||
219 | |||
214 | for (i = 0; i < 8; i++) { | 220 | for (i = 0; i < 8; i++) { |
215 | if (rule->map & (1 << xtab[i])) { | 221 | if (rule->map & (1 << xtab[i])) { |
216 | res->start = res->end = xtab[i]; | 222 | 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) | |||
218 | goto __add; | 224 | goto __add; |
219 | } | 225 | } |
220 | } | 226 | } |
221 | #ifdef MAX_DMA_CHANNELS | 227 | |
222 | res->start = res->end = MAX_DMA_CHANNELS; | 228 | pnp_dbg(&dev->dev, " couldn't assign dma %d\n", idx); |
223 | #endif | 229 | return -EBUSY; |
224 | res->flags |= IORESOURCE_DISABLED; | ||
225 | pnp_dbg(&dev->dev, " disable dma %d\n", idx); | ||
226 | 230 | ||
227 | __add: | 231 | __add: |
228 | pnp_add_dma_resource(dev, res->start, res->flags); | 232 | pnp_add_dma_resource(dev, res->start, res->flags); |