* Updated in 2003 by Samy Al Bahra <samy@kerneled.com>
* Updated in 2017 by Imre Vadász <imrevdsz@gmail.com>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <errno.h>
}
static void
-fbsd_fill_info(struct pci_dev *d, int flags)
+fbsd_fill_info(struct pci_dev *d, unsigned int flags)
{
struct pci_conf_io conf;
struct pci_bar_io bar;
if (ioctl(d->access->fd, PCIOCGETCONF, &conf) < 0)
{
- if (errno == ENODEV)
- return 0;
- d->access->error("fbsd_fill_info: ioctl(PCIOCGETCONF) failed: %s", strerror(errno));
+ if (errno != ENODEV)
+ d->access->error("fbsd_fill_info: ioctl(PCIOCGETCONF) failed: %s", strerror(errno));
+ return;
}
if (want_fill(d, flags, PCI_FILL_IDENT))
}
if (want_fill(d, flags, PCI_FILL_CLASS))
d->device_class = (match.pc_class << 8) | match.pc_subclass;
- if (want_fill(d, flags PCI_FILL_BASES | PCI_FILL_SIZES))
+ if (want_fill(d, flags, PCI_FILL_BASES | PCI_FILL_SIZES))
{
d->rom_base_addr = 0;
d->rom_size = 0;
if (ioctl(d->access->fd, PCIOCGETBAR, &bar) < 0)
{
if (errno == ENODEV)
- return 0;
+ return;
if (errno == EINVAL)
{
d->base_addr[i] = 0;
}
struct pci_methods pm_fbsd_device = {
- "fbsd-device",
- "FreeBSD /dev/pci device",
- fbsd_config,
- fbsd_detect,
- fbsd_init,
- fbsd_cleanup,
- fbsd_scan,
- fbsd_fill_info,
- fbsd_read,
- fbsd_write,
- NULL, /* read_vpd */
- NULL, /* dev_init */
- NULL /* dev_cleanup */
+ .name = "fbsd-device",
+ .help = "FreeBSD /dev/pci device",
+ .config = fbsd_config,
+ .detect = fbsd_detect,
+ .init = fbsd_init,
+ .cleanup = fbsd_cleanup,
+ .scan = fbsd_scan,
+ .fill_info = fbsd_fill_info,
+ .read = fbsd_read,
+ .write = fbsd_write,
};