/* Checks if a BAR is configured and points to MMIO space. If so, return an error code. Otherwise return 0  */
static int ide_pci_check_iomem(struct pci_dev *dev, const struct ide_port_info *d, int bar)
/* Checks if a BAR is configured and points to MMIO space. If so, return an error code. Otherwise return 0  */
static int ide_pci_check_iomem(struct pci_dev *dev, const struct ide_port_info *d, int bar)
{
	ulong flags = pci_resource_flags(dev, bar);
	if (!flags || pci_resource_len(dev, bar) == 0)
		return 0;
	if (flags & IORESOURCE_IO)
		return 0;
	return -EINVAL;
}