PNPACPI: hoist dma_flags() out of pnpacpi_parse_allocated_dmaresource()
Hoist dma_flags() out of pnpacpi_parse_allocated_dmaresource() into its caller. This makes pnpacpi_parse_allocated_dmaresource() more similar to pnpbios_parse_allocated_dmaresource(). Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-By: Rene Herman <rene.herman@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
9570a20e9d
commit
bb84b41d1a
1 changed files with 4 additions and 7 deletions
|
@ -169,8 +169,7 @@ static int dma_flags(int type, int bus_master, int transfer)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
|
static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
|
||||||
u32 dma, int type,
|
u32 dma, int flags)
|
||||||
int bus_master, int transfer)
|
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
static unsigned char warned;
|
static unsigned char warned;
|
||||||
|
@ -180,8 +179,7 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
|
||||||
i++;
|
i++;
|
||||||
if (i < PNP_MAX_DMA) {
|
if (i < PNP_MAX_DMA) {
|
||||||
res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag
|
res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag
|
||||||
res->dma_resource[i].flags |=
|
res->dma_resource[i].flags |= flags;
|
||||||
dma_flags(type, bus_master, transfer);
|
|
||||||
if (dma == -1) {
|
if (dma == -1) {
|
||||||
res->dma_resource[i].flags |= IORESOURCE_DISABLED;
|
res->dma_resource[i].flags |= IORESOURCE_DISABLED;
|
||||||
return;
|
return;
|
||||||
|
@ -311,9 +309,8 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
|
||||||
if (dma->channel_count > 0)
|
if (dma->channel_count > 0)
|
||||||
pnpacpi_parse_allocated_dmaresource(res_table,
|
pnpacpi_parse_allocated_dmaresource(res_table,
|
||||||
dma->channels[0],
|
dma->channels[0],
|
||||||
dma->type,
|
dma_flags(dma->type, dma->bus_master,
|
||||||
dma->bus_master,
|
dma->transfer));
|
||||||
dma->transfer);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACPI_RESOURCE_TYPE_IO:
|
case ACPI_RESOURCE_TYPE_IO:
|
||||||
|
|
Reference in a new issue