Lines Matching +full:non +full:- +full:negative

1 // SPDX-License-Identifier: GPL-2.0+
6 * COMEDI - Linux Control and Measurement Device Interface
7 * Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
16 * comedi_to_pci_dev() - Return PCI device attached to COMEDI device
19 * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a
22 * Return: Attached PCI device if @dev->hw_dev is non-%NULL.
23 * Return %NULL if @dev->hw_dev is %NULL.
27 return dev->hw_dev ? to_pci_dev(dev->hw_dev) : NULL; in comedi_to_pci_dev()
32 * comedi_pci_enable() - Enable the PCI device and request the regions
35 * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a
37 * and request its regions. Set @dev->ioenabled to %true if successful,
44 * -%ENODEV if @dev->hw_dev is %NULL,
45 * -%EBUSY if regions busy,
46 * or some negative error number if failed to enable PCI device.
55 return -ENODEV; in comedi_pci_enable()
61 rc = pci_request_regions(pcidev, dev->board_name); in comedi_pci_enable()
65 dev->ioenabled = true; in comedi_pci_enable()
72 * comedi_pci_disable() - Release the regions and disable the PCI device
75 * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a
78 * and disable it. Reset @dev->ioenabled back to %false.
84 if (pcidev && dev->ioenabled) { in comedi_pci_disable()
88 dev->ioenabled = false; in comedi_pci_disable()
93 * comedi_pci_detach() - A generic "detach" handler for PCI COMEDI drivers
96 * COMEDI drivers for PCI devices that need no special clean-up of private data
97 * and have no ioremapped regions other than that pointed to by @dev->mmio may
99 * COMEDI device is being detached from the low-level driver. It may be also
100 * called from a more specific "detach" handler that does additional clean-up.
102 * Free the IRQ if @dev->irq is non-zero, iounmap @dev->mmio if it is
103 * non-%NULL, and call comedi_pci_disable() to release the PCI device's regions
110 if (!pcidev || !dev->ioenabled) in comedi_pci_detach()
113 if (dev->irq) { in comedi_pci_detach()
114 free_irq(dev->irq, dev); in comedi_pci_detach()
115 dev->irq = 0; in comedi_pci_detach()
117 if (dev->mmio) { in comedi_pci_detach()
118 iounmap(dev->mmio); in comedi_pci_detach()
119 dev->mmio = NULL; in comedi_pci_detach()
126 * comedi_pci_auto_config() - Configure/probe a PCI COMEDI device
131 * Typically called from the pci_driver (*probe) function. Auto-configure
138 * a negative error number on failure).
144 return comedi_auto_config(&pcidev->dev, driver, context); in comedi_pci_auto_config()
149 * comedi_pci_auto_unconfig() - Unconfigure/remove a PCI COMEDI device
152 * Typically called from the pci_driver (*remove) function. Auto-unconfigure
164 comedi_auto_unconfig(&pcidev->dev); in comedi_pci_auto_unconfig()
169 * comedi_pci_driver_register() - Register a PCI COMEDI driver
177 * Return: 0 on success, or a negative error number on failure.
199 * comedi_pci_driver_unregister() - Unregister a PCI COMEDI driver