本文整理汇总了C++中pci_release_region函数的典型用法代码示例。如果您正苦于以下问题:C++ pci_release_region函数的具体用法?C++ pci_release_region怎么用?C++ pci_release_region使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pci_release_region函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: kp2000_pcie_remove
static void kp2000_pcie_remove(struct pci_dev *pdev)
{
struct kp2000_device *pcard = pci_get_drvdata(pdev);
dev_dbg(&pdev->dev, "kp2000_pcie_remove(pdev=%p)\n", pdev);
if (pcard == NULL)
return;
mutex_lock(&pcard->sem);
kp2000_remove_cores(pcard);
mfd_remove_devices(PCARD_TO_DEV(pcard));
misc_deregister(&pcard->miscdev);
sysfs_remove_files(&(pdev->dev.kobj), kp_attr_list);
free_irq(pcard->pdev->irq, pcard);
pci_disable_msi(pcard->pdev);
if (pcard->dma_bar_base != NULL) {
iounmap(pcard->dma_bar_base);
pci_release_region(pdev, DMA_BAR);
pcard->dma_bar_base = NULL;
}
if (pcard->regs_bar_base != NULL) {
iounmap(pcard->regs_bar_base);
pci_release_region(pdev, REG_BAR);
pcard->regs_bar_base = NULL;
}
pci_disable_device(pcard->pdev);
pci_set_drvdata(pdev, NULL);
mutex_unlock(&pcard->sem);
ida_simple_remove(&card_num_ida, pcard->card_num);
kfree(pcard);
}
开发者ID:grate-driver,项目名称:linux,代码行数:32,代码来源:core.c
示例2: cxl_map_adapter_regs
static int cxl_map_adapter_regs(struct cxl *adapter, struct pci_dev *dev)
{
if (pci_request_region(dev, 2, "priv 2 regs"))
goto err1;
if (pci_request_region(dev, 0, "priv 1 regs"))
goto err2;
pr_devel("cxl_map_adapter_regs: p1: %#.16llx %#llx, p2: %#.16llx %#llx",
p1_base(dev), p1_size(dev), p2_base(dev), p2_size(dev));
if (!(adapter->p1_mmio = ioremap(p1_base(dev), p1_size(dev))))
goto err3;
if (!(adapter->p2_mmio = ioremap(p2_base(dev), p2_size(dev))))
goto err4;
return 0;
err4:
iounmap(adapter->p1_mmio);
adapter->p1_mmio = NULL;
err3:
pci_release_region(dev, 0);
err2:
pci_release_region(dev, 2);
err1:
return -ENOMEM;
}
开发者ID:greguu,项目名称:linux-4.2.3-c3x00,代码行数:28,代码来源:pci.c
示例3: intel_mcu_remove
static void intel_mcu_remove(struct pci_dev *pdev)
{
struct mcu *mcu;
mcu = dev_get_drvdata(&pdev->dev);
iounmap((void __iomem *)mcu->ddr[0]);
iounmap((void __iomem *)mcu->ddr[1]);
pci_release_region(pdev, 0);
pci_release_region(pdev, 1);
pci_dev_put(pdev);
}
开发者ID:0x000000FF,项目名称:Linux4Edison,代码行数:12,代码来源:intel_mcu_common.c
示例4: asd_unmap_memio
static void __devexit asd_unmap_memio(struct asd_ha_struct *asd_ha)
{
struct asd_ha_addrspace *io_handle;
io_handle = &asd_ha->io_handle[1];
iounmap(io_handle->addr);
pci_release_region(asd_ha->pcidev, 2);
io_handle = &asd_ha->io_handle[0];
iounmap(io_handle->addr);
pci_release_region(asd_ha->pcidev, 0);
}
开发者ID:Mr-Aloof,项目名称:wl500g,代码行数:12,代码来源:aic94xx_init.c
示例5: asd_map_memio
static int asd_map_memio(struct asd_ha_struct *asd_ha)
{
int err, i;
struct asd_ha_addrspace *io_handle;
asd_ha->iospace = 0;
for (i = 0; i < 3; i += 2) {
io_handle = &asd_ha->io_handle[i==0?0:1];
io_handle->start = pci_resource_start(asd_ha->pcidev, i);
io_handle->len = pci_resource_len(asd_ha->pcidev, i);
io_handle->flags = pci_resource_flags(asd_ha->pcidev, i);
err = -ENODEV;
if (!io_handle->start || !io_handle->len) {
asd_printk("MBAR%d start or length for %s is 0.\n",
i==0?0:1, pci_name(asd_ha->pcidev));
goto Err;
}
err = pci_request_region(asd_ha->pcidev, i, ASD_DRIVER_NAME);
if (err) {
asd_printk("couldn't reserve memory region for %s\n",
pci_name(asd_ha->pcidev));
goto Err;
}
if (io_handle->flags & IORESOURCE_CACHEABLE)
io_handle->addr = ioremap(io_handle->start,
io_handle->len);
else
io_handle->addr = ioremap_nocache(io_handle->start,
io_handle->len);
if (!io_handle->addr) {
asd_printk("couldn't map MBAR%d of %s\n", i==0?0:1,
pci_name(asd_ha->pcidev));
err = -ENOMEM;
goto Err_unreq;
}
}
return 0;
Err_unreq:
pci_release_region(asd_ha->pcidev, i);
Err:
if (i > 0) {
io_handle = &asd_ha->io_handle[0];
iounmap(io_handle->addr);
pci_release_region(asd_ha->pcidev, 0);
}
return err;
}
开发者ID:aejsmith,项目名称:linux,代码行数:48,代码来源:aic94xx_init.c
示例6: OSPCIReleaseDev
/*************************************************************************/ /*!
@Function OSPCIReleaseDev
@Description Release a PCI device that is no longer being used
@Input hPVRPCI PCI device handle
@Return PVRSRV_ERROR Services error code
*/ /**************************************************************************/
PVRSRV_ERROR OSPCIReleaseDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
{
PVR_PCI_DEV *psPVRPCI = (PVR_PCI_DEV *)hPVRPCI;
int i;
/* Release all PCI regions that are currently in use */
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
{
if (psPVRPCI->abPCIResourceInUse[i])
{
pci_release_region(psPVRPCI->psPCIDev, i);
psPVRPCI->abPCIResourceInUse[i] = IMG_FALSE;
}
}
#if defined(CONFIG_PCI_MSI)
if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_MSI) /* PRQA S 3358 */ /* misuse of enums */
{
pci_disable_msi(psPVRPCI->psPCIDev);
}
#endif
if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER) /* PRQA S 3358 */ /* misuse of enums */
{
pci_clear_master(psPVRPCI->psPCIDev);
}
pci_disable_device(psPVRPCI->psPCIDev);
kfree((IMG_VOID *)psPVRPCI);
/*not nulling pointer, copy on stack*/
return PVRSRV_OK;
}
开发者ID:DanBjorklund,项目名称:ME302C,代码行数:40,代码来源:pci_support.c
示例7: wil_pcie_remove
static void wil_pcie_remove(struct pci_dev *pdev)
{
struct wil6210_priv *wil = pci_get_drvdata(pdev);
void __iomem *csr = wil->csr;
wil_dbg_misc(wil, "%s()\n", __func__);
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
unregister_pm_notifier(&wil->pm_notify);
#endif /* CONFIG_PM_SLEEP */
#endif /* CONFIG_PM */
wil6210_debugfs_remove(wil);
rtnl_lock();
wil_p2p_wdev_free(wil);
rtnl_unlock();
wil_if_remove(wil);
wil_if_pcie_disable(wil);
pci_iounmap(pdev, csr);
pci_release_region(pdev, 0);
pci_disable_device(pdev);
if (wil->platform_ops.uninit)
wil->platform_ops.uninit(wil->platform_handle);
wil_if_free(wil);
}
开发者ID:acton393,项目名称:linux,代码行数:26,代码来源:pcie_bus.c
示例8: tpci200_unregister
static void tpci200_unregister(struct tpci200_board *tpci200)
{
free_irq(tpci200->info->pdev->irq, (void *) tpci200);
pci_iounmap(tpci200->info->pdev, tpci200->info->interface_regs);
pci_iounmap(tpci200->info->pdev, tpci200->info->cfg_regs);
pci_release_region(tpci200->info->pdev, TPCI200_IP_INTERFACE_BAR);
pci_release_region(tpci200->info->pdev, TPCI200_IO_ID_INT_SPACES_BAR);
pci_release_region(tpci200->info->pdev, TPCI200_MEM16_SPACE_BAR);
pci_release_region(tpci200->info->pdev, TPCI200_MEM8_SPACE_BAR);
pci_release_region(tpci200->info->pdev, TPCI200_CFG_MEM_BAR);
pci_disable_device(tpci200->info->pdev);
pci_dev_put(tpci200->info->pdev);
}
开发者ID:kennethlyn,项目名称:parallella-lcd-linux,代码行数:16,代码来源:tpci200.c
示例9: tc86c001_init_one
static int __devinit tc86c001_init_one(struct pci_dev *dev,
const struct pci_device_id *id)
{
int rc;
rc = pci_enable_device(dev);
if (rc)
goto out;
rc = pci_request_region(dev, 5, DRV_NAME);
if (rc) {
printk(KERN_ERR DRV_NAME ": system control regs already in use");
goto out_disable;
}
rc = ide_pci_init_one(dev, &tc86c001_chipset, NULL);
if (rc)
goto out_release;
goto out;
out_release:
pci_release_region(dev, 5);
out_disable:
pci_disable_device(dev);
out:
return rc;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:28,代码来源:tc86c001.c
示例10: virtio_pci_legacy_probe
/* the PCI probing function */
int virtio_pci_legacy_probe(struct virtio_pci_device *vp_dev)
{
struct pci_dev *pci_dev = vp_dev->pci_dev;
int rc;
/* We only own devices >= 0x1000 and <= 0x103f: leave the rest. */
if (pci_dev->device < 0x1000 || pci_dev->device > 0x103f)
return -ENODEV;
if (pci_dev->revision != VIRTIO_PCI_ABI_VERSION) {
printk(KERN_ERR "virtio_pci: expected ABI version %d, got %d\n",
VIRTIO_PCI_ABI_VERSION, pci_dev->revision);
return -ENODEV;
}
rc = dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(64));
if (rc) {
rc = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32));
} else {
/*
* The virtio ring base address is expressed as a 32-bit PFN,
* with a page size of 1 << VIRTIO_PCI_QUEUE_ADDR_SHIFT.
*/
dma_set_coherent_mask(&pci_dev->dev,
DMA_BIT_MASK(32 + VIRTIO_PCI_QUEUE_ADDR_SHIFT));
}
if (rc)
dev_warn(&pci_dev->dev, "Failed to enable 64-bit or 32-bit DMA. Trying to continue, but this might not work.\n");
rc = pci_request_region(pci_dev, 0, "virtio-pci-legacy");
if (rc)
return rc;
rc = -ENOMEM;
vp_dev->ioaddr = pci_iomap(pci_dev, 0, 0);
if (!vp_dev->ioaddr)
goto err_iomap;
vp_dev->isr = vp_dev->ioaddr + VIRTIO_PCI_ISR;
/* we use the subsystem vendor/device id as the virtio vendor/device
* id. this allows us to use the same PCI vendor/device id for all
* virtio devices and to identify the particular virtio driver by
* the subsystem ids */
vp_dev->vdev.id.vendor = pci_dev->subsystem_vendor;
vp_dev->vdev.id.device = pci_dev->subsystem_device;
vp_dev->vdev.config = &virtio_pci_config_ops;
vp_dev->config_vector = vp_config_vector;
vp_dev->setup_vq = setup_vq;
vp_dev->del_vq = del_vq;
return 0;
err_iomap:
pci_release_region(pci_dev, 0);
return rc;
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:61,代码来源:virtio_pci_legacy.c
示例11: virtio_pci_legacy_remove
void virtio_pci_legacy_remove(struct virtio_pci_device *vp_dev)
{
struct pci_dev *pci_dev = vp_dev->pci_dev;
pci_iounmap(pci_dev, vp_dev->ioaddr);
pci_release_region(pci_dev, 0);
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:7,代码来源:virtio_pci_legacy.c
示例12: ath_pci_cleanup
static void ath_pci_cleanup(struct ath_softc *sc)
{
struct pci_dev *pdev = to_pci_dev(sc->dev);
pci_iounmap(pdev, sc->mem);
pci_disable_device(pdev);
pci_release_region(pdev, 0);
}
开发者ID:Addision,项目名称:LVS,代码行数:8,代码来源:pci.c
示例13: piix4_poweroff_remove
static void piix4_poweroff_remove(struct pci_dev *dev)
{
if (pm_power_off == piix4_poweroff)
pm_power_off = NULL;
pci_release_region(dev, piix4_pm_io_region);
pm_dev = NULL;
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:8,代码来源:piix4-poweroff.c
示例14: test_pci_remove
static void test_pci_remove(struct pci_dev *pdev)
{
pci_free_consistent(dev_data->pdev, TEST_CDMA_BUFFER_SIZE,
dev_data->cdma_buffer, dev_data->cdma_addr);
cdev_del(dev_data->cdev);
unregister_chrdev_region(test_pci_devt, test_pci_devs_max);
free_irq(dev_data->pdev->irq, dev_data->pdev);
iounmap(dev_data->mmio_addr);
pci_release_region(dev_data->pdev, BAR_MMIO);
pci_release_region(dev_data->pdev, BAR_PIO);
pci_disable_device(dev_data->pdev);
tprintk("%s driver (major %d) unloaded\n", DRIVER_TEST_NAME, test_pci_major);
}
开发者ID:Jameshzc,项目名称:qemu_example_virtual_pcidev,代码行数:18,代码来源:test_pci_driver.c
示例15: cxl_remove_adapter
static void cxl_remove_adapter(struct cxl *adapter)
{
struct pci_dev *pdev = to_pci_dev(adapter->dev.parent);
pr_devel("cxl_release_adapter\n");
cxl_sysfs_adapter_remove(adapter);
cxl_debugfs_adapter_remove(adapter);
cxl_release_psl_err_irq(adapter);
cxl_unmap_adapter_regs(adapter);
cxl_remove_adapter_nr(adapter);
device_unregister(&adapter->dev);
pci_release_region(pdev, 0);
pci_release_region(pdev, 2);
pci_disable_device(pdev);
}
开发者ID:greguu,项目名称:linux-4.2.3-c3x00,代码行数:18,代码来源:pci.c
示例16: cs5535_gpio_probe
static int __init cs5535_gpio_probe(struct pci_dev *pdev,
const struct pci_device_id *pci_id)
{
int err;
ulong mask_orig = mask;
/* There are two ways to get the GPIO base address; one is by
* fetching it from MSR_LBAR_GPIO, the other is by reading the
* PCI BAR info. The latter method is easier (especially across
* different architectures), so we'll stick with that for now. If
* it turns out to be unreliable in the face of crappy BIOSes, we
* can always go back to using MSRs.. */
err = pci_enable_device_io(pdev);
if (err) {
dev_err(&pdev->dev, "can't enable device IO\n");
goto done;
}
err = pci_request_region(pdev, GPIO_BAR, DRV_NAME);
if (err) {
dev_err(&pdev->dev, "can't alloc PCI BAR #%d\n", GPIO_BAR);
goto done;
}
/* set up the driver-specific struct */
cs5535_gpio_chip.base = pci_resource_start(pdev, GPIO_BAR);
cs5535_gpio_chip.pdev = pdev;
spin_lock_init(&cs5535_gpio_chip.lock);
dev_info(&pdev->dev, "allocated PCI BAR #%d: base 0x%llx\n", GPIO_BAR,
(unsigned long long) cs5535_gpio_chip.base);
/* mask out reserved pins */
mask &= 0x1F7FFFFF;
/* do not allow pin 28, Power Button, as there's special handling
* in the PMC needed. (note 12, p. 48) */
mask &= ~(1 << 28);
if (mask_orig != mask)
dev_info(&pdev->dev, "mask changed from 0x%08lX to 0x%08lX\n",
mask_orig, mask);
/* finally, register with the generic GPIO API */
err = gpiochip_add(&cs5535_gpio_chip.chip);
if (err)
goto release_region;
dev_info(&pdev->dev, DRV_NAME ": GPIO support successfully loaded.\n");
return 0;
release_region:
pci_release_region(pdev, GPIO_BAR);
done:
return err;
}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:57,代码来源:cs5535-gpio.c
示例17: rtbt_pci_remove
static void rtbt_pci_remove(struct pci_dev *pdev)
{
struct hci_dev *hci_dev = (struct hci_dev *)pci_get_drvdata(pdev);
struct rtbt_os_ctrl *os_ctrl;
struct rtbt_dev_ops *dev_ops;
void __iomem *csr_addr;
if (hci_dev == NULL){
printk("%s(): pci_get_drvdata failed!\n", __FUNCTION__);
return;
}
os_ctrl = (struct rtbt_os_ctrl *) hci_get_drvdata(hci_dev);
if (os_ctrl == NULL) {
printk("%s(): hci_dev->driver_data is NULL!\n", __FUNCTION__);
return;
}
csr_addr = os_ctrl->if_ops.pci_ops.csr_addr;
printk("%s():csr_addr=0x%lx!\n", __FUNCTION__,
(unsigned long)os_ctrl->if_ops.pci_ops.csr_addr);
#if 0
rtbt_hps_iface_detach(os_ctrl);
#endif
rtbt_hps_iface_deinit(RAL_INF_PCI, pdev, os_ctrl);
rtbth_us_deinit(os_ctrl->dev_ctrl);
if (os_ctrl->dev_ops) {
dev_ops = os_ctrl->dev_ops;
if (dev_ops->dev_resource_deinit)
dev_ops->dev_resource_deinit(os_ctrl);
if (dev_ops->dev_ctrl_deinit)
dev_ops->dev_ctrl_deinit(os_ctrl);
}
// rtbth_us_deinit(os_ctrl->dev_ctrl);
pci_set_drvdata(pdev, NULL);
if (csr_addr != NULL) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9)
pci_iounmap(pdev, csr_addr);
#else
iounmap(csr_addr);
#endif
}
pci_release_region(pdev, 0);
pci_disable_device(pdev);
printk("Exit from rtbt_pci_remove!\n");
}
开发者ID:andyvand,项目名称:rtbth,代码行数:55,代码来源:rtbth_core_pci.c
示例18: OSPCIAddrRangeFunc
/*************************************************************************/ /*!
@Function OSPCIAddrRangeFunc
@Description Internal support function for various address range related
functions
@Input eFunc Function to perform
@Input hPVRPCI PCI device handle
@Input ui32Index Address range index
@Return IMG_UINT32 Function dependent value
*/ /**************************************************************************/
static IMG_UINT32 OSPCIAddrRangeFunc(enum HOST_PCI_ADDR_RANGE_FUNC eFunc,
PVRSRV_PCI_DEV_HANDLE hPVRPCI,
IMG_UINT32 ui32Index)
{
PVR_PCI_DEV *psPVRPCI = (PVR_PCI_DEV *)hPVRPCI;
if (ui32Index >= DEVICE_COUNT_RESOURCE)
{
printk(KERN_ERR "OSPCIAddrRangeFunc: Index out of range");
return 0;
}
switch (eFunc)
{
case HOST_PCI_ADDR_RANGE_FUNC_LEN:
{
return pci_resource_len(psPVRPCI->psPCIDev, ui32Index);
}
case HOST_PCI_ADDR_RANGE_FUNC_START:
{
return pci_resource_start(psPVRPCI->psPCIDev, ui32Index);
}
case HOST_PCI_ADDR_RANGE_FUNC_END:
{
return pci_resource_end(psPVRPCI->psPCIDev, ui32Index);
}
case HOST_PCI_ADDR_RANGE_FUNC_REQUEST:
{
int err = pci_request_region(psPVRPCI->psPCIDev, (IMG_INT)ui32Index, PVRSRV_MODNAME);
if (err != 0)
{
printk(KERN_ERR "OSPCIAddrRangeFunc: pci_request_region_failed (%d)", err);
return 0;
}
psPVRPCI->abPCIResourceInUse[ui32Index] = IMG_TRUE;
return 1;
}
case HOST_PCI_ADDR_RANGE_FUNC_RELEASE:
{
if (psPVRPCI->abPCIResourceInUse[ui32Index])
{
pci_release_region(psPVRPCI->psPCIDev, (IMG_INT)ui32Index);
psPVRPCI->abPCIResourceInUse[ui32Index] = IMG_FALSE;
}
return 1;
}
default:
{
printk(KERN_ERR "OSPCIAddrRangeFunc: Unknown function");
break;
}
}
return 0;
}
开发者ID:DanBjorklund,项目名称:ME302C,代码行数:64,代码来源:pci_support.c
示例19: spi_pci_remove
static void __devexit spi_pci_remove(struct pci_dev *pdev)
{
struct dw_spi_pci *dwpci = pci_get_drvdata(pdev);
pci_set_drvdata(pdev, NULL);
dw_spi_remove_host(&dwpci->dws);
iounmap(dwpci->dws.regs);
pci_release_region(pdev, 0);
kfree(dwpci);
pci_disable_device(pdev);
}
开发者ID:Scorpio92,项目名称:mstar6a918,代码行数:11,代码来源:spi-dw-pci.c
示例20: chipsfb_remove
static void chipsfb_remove(struct pci_dev *dp)
{
struct fb_info *p = pci_get_drvdata(dp);
if (p->screen_base == NULL)
return;
unregister_framebuffer(p);
iounmap(p->screen_base);
p->screen_base = NULL;
pci_release_region(dp, 0);
}
开发者ID:7799,项目名称:linux,代码行数:11,代码来源:chipsfb.c
注:本文中的pci_release_region函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论