Re: [PATCH v2 1/2] dma-mapping: move dma configuration to bus infrastructure

From: hch@xxxxxx
Date: Thu Mar 22 2018 - 04:17:15 EST


> > +int dma_configure(struct device *dev)
> > +{
> > + if (dev->bus->dma_configure)
> > + return dev->bus->dma_configure(dev);
>
> What if dma_common_configure() is called in case "bus->dma_configure" is not defined?

Then we'd still have a dependency of common code on OF and ACPI.

On the other hand we'd get free OF and ACPI dma ranges parsing for
everyone, which might be handy. And which would really help mitigating
the risk that we missed some bus that gets dma configuration from OF,
so maybe it actually is a good idea. I'd just rename it to
dma_default_configure or similar in that case.