Messages in this thread | | | From | James Bottomley <> | Subject | Re: DMA masks | Date | Fri, 9 Aug 2013 14:56:14 +0000 |
| |
On Fri, 2013-08-09 at 11:12 +0200, Krzysztof Hałasa wrote: > Hi, > > I'm trying to understand why the struct device contains a pointer to > dma_mask and not the actual dma_mask:
It's an anachronism. The original reason was when this was introduced, struct pci_device was the only device that actually had one. On PA-RISC we needed to walk the device tree by generic device and set the DMA mask on generic devices, which meant we either had to special case the PCI device, rearchitect the whole of the PCI device mask setting to use the generic device, or cheat and make the generic device dma mask a pointer to the PCI one. I took the latter option because it's simpler.
James
| |