On 2011-06-08 14:28, Gerd Hoffmann wrote: >> @@ -1173,12 +1173,8 @@ static int intel_hda_exit(PCIDevice *pci) >> static void intel_hda_write_config(PCIDevice *pci, uint32_t addr, >> uint32_t val, int len) >> { >> - IntelHDAState *d = DO_UPCAST(IntelHDAState, pci, pci); >> - >> pci_default_write_config(pci, addr, val, len); >> - if (d->msi) { >> - msi_write_config(pci, addr, val, len); >> - } >> + msi_write_config(pci, addr, val, len); >> } > > Nothing device specific left in there now. If msi_write_config() checks > itself whenever msi is enabled or not we could call it from > pci_default_write_config(), then zap this function altogether, no?
Well, we could put those helpers (msi_write_config, msi_reset, maybe more) into generic PCI code. Then device will only have to overload the handlers if they do something in addition. Haven't checked the details yet, though. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux