- if (dma_base && !(pcicmd & PCI_COMMAND_MASTER)) {
- /*
- * Set up BM-DMA capability
- * (PnP BIOS should have done this)
- */
- pci_set_master(dev);
- if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd) || !(pcicmd & PCI_COMMAND_MASTER)) {
- printk(KERN_ERR "%s: %s error updating PCICMD\n",
- hwif->name, d->name);
- dma_base = 0;
- }
- }
- if (dma_base) {
- if (d->init_dma)
- d->init_dma(hwif, dma_base);
-
- ide_setup_dma(hwif, dma_base);
- } else {
- printk(KERN_INFO "%s: %s Bus-Master DMA disabled "
- "(BIOS)\n", hwif->name, d->name);
- }
+
+ if (dma_base == 0 || ide_pci_set_master(dev, d->name) < 0)
+ goto out_disabled;
+
+ if (d->init_dma)
+ d->init_dma(hwif, dma_base);
+
+ ide_setup_dma(hwif, dma_base);