On Friday 30 May 2008 03:15:57 pm Rene Herman wrote:
It gets uglier. ALSA ISA drivers (for cards that exist both as legacy and as ISAPnP at least) keep a merged legacy/isapnp model; PnP is used mostly for initializing global variables that the same old legacy probe routines then reference. This means that beyond that global resource init step the specific struct device is no longer available. Without restructuring too many things really only fixable through other hacks again such as a global dma_dev[] array or some such.
From the viewpoint of PnP itself setting the dma_mask for a pnp_card (a pnp_dev collection) makes isolated sense so if no objections, I'll submit the attached after all. From the ALSA side we'd then pass the card dev (which we'd also do for isa_dev) and keep in mind that we might want to get more specific if over time structure permits it.
struct snd_pcm already has its own struct device * which would be the right one here but it's setting that which gets ugly...
Looks good to me. It does sound like a lot of work and possibly
more risk than it's worth to fix up some of this stuff.
I do still wonder whether any non-x86 architectures need similar
fixes in dma_alloc_coherent(), i.e., check for dev==NULL and fall
back to a 24-bit DMA mask.
Acked-by: Bjorn Helgaas <bjorn.helgaas@xxxxxx>