Path: blob/master/arch/frv/mb93090-mb00/pci-iomap.c
10817 views
/* pci-iomap.c: description1*2* Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.3* Written by David Howells ([email protected])4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public License7* as published by the Free Software Foundation; either version8* 2 of the License, or (at your option) any later version.9*/10#include <linux/pci.h>11#include <linux/module.h>1213void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)14{15resource_size_t start = pci_resource_start(dev, bar);16resource_size_t len = pci_resource_len(dev, bar);17unsigned long flags = pci_resource_flags(dev, bar);1819if (!len || !start)20return NULL;2122if ((flags & IORESOURCE_IO) || (flags & IORESOURCE_MEM))23return (void __iomem *) start;2425return NULL;26}2728EXPORT_SYMBOL(pci_iomap);293031