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>
15 * comedi_to_pci_dev() - Return PCI device attached to COMEDI device
18 * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a
21 * Return: Attached PCI device if @dev->hw_dev is non-%NULL.
22 * Return %NULL if @dev->hw_dev is %NULL.
26 return dev->hw_dev ? to_pci_dev(dev->hw_dev) : NULL; in comedi_to_pci_dev()
31 * comedi_pci_enable() - Enable the PCI device and request the regions
34 * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a
36 * and request its regions. Set @dev->ioenabled to %true if successful,
43 * -%ENODEV if @dev->hw_dev is %NULL,
44 * -%EBUSY if regions busy,
45 * or some negative error number if failed to enable PCI device.
54 return -ENODEV; in comedi_pci_enable()
60 rc = pci_request_regions(pcidev, dev->board_name); in comedi_pci_enable()
64 dev->ioenabled = true; in comedi_pci_enable()
71 * comedi_pci_disable() - Release the regions and disable the PCI device
74 * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a
77 * and disable it. Reset @dev->ioenabled back to %false.
83 if (pcidev && dev->ioenabled) { in comedi_pci_disable()
87 dev->ioenabled = false; in comedi_pci_disable()
92 * comedi_pci_detach() - A generic "detach" handler for PCI COMEDI drivers
95 * COMEDI drivers for PCI devices that need no special clean-up of private data
96 * and have no ioremapped regions other than that pointed to by @dev->mmio may
98 * COMEDI device is being detached from the low-level driver. It may be also
99 * called from a more specific "detach" handler that does additional clean-up.
101 * Free the IRQ if @dev->irq is non-zero, iounmap @dev->mmio if it is
102 * non-%NULL, and call comedi_pci_disable() to release the PCI device's regions
109 if (!pcidev || !dev->ioenabled) in comedi_pci_detach()
112 if (dev->irq) { in comedi_pci_detach()
113 free_irq(dev->irq, dev); in comedi_pci_detach()
114 dev->irq = 0; in comedi_pci_detach()
116 if (dev->mmio) { in comedi_pci_detach()
117 iounmap(dev->mmio); in comedi_pci_detach()
118 dev->mmio = NULL; in comedi_pci_detach()
125 * comedi_pci_auto_config() - Configure/probe a PCI COMEDI device
130 * Typically called from the pci_driver (*probe) function. Auto-configure
137 * a negative error number on failure).
143 return comedi_auto_config(&pcidev->dev, driver, context); in comedi_pci_auto_config()
148 * comedi_pci_auto_unconfig() - Unconfigure/remove a PCI COMEDI device
151 * Typically called from the pci_driver (*remove) function. Auto-unconfigure
163 comedi_auto_unconfig(&pcidev->dev); in comedi_pci_auto_unconfig()
168 * comedi_pci_driver_register() - Register a PCI COMEDI driver
176 * Return: 0 on success, or a negative error number on failure.
198 * comedi_pci_driver_unregister() - Unregister a PCI COMEDI driver