acpi_pcidev_find_dev(): take struct acpi_devnode as a parameter.

This commit is contained in:
jruoho 2010-12-31 10:56:39 +00:00
parent aa705fc95d
commit 396210649d
3 changed files with 18 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_pci.c,v 1.17 2010/12/31 10:23:44 jruoho Exp $ */ /* $NetBSD: acpi_pci.c,v 1.18 2010/12/31 10:56:39 jruoho Exp $ */
/* /*
* Copyright (c) 2009, 2010 The NetBSD Foundation, Inc. * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_pci.c,v 1.17 2010/12/31 10:23:44 jruoho Exp $"); __KERNEL_RCSID(0, "$NetBSD: acpi_pci.c,v 1.18 2010/12/31 10:56:39 jruoho Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/device.h> #include <sys/device.h>
@ -397,15 +397,21 @@ acpi_pcidev_find(uint16_t segment, uint16_t bus,
* if it doesn't exist. * if it doesn't exist.
*/ */
device_t device_t
acpi_pcidev_find_dev(struct acpi_pci_info *ap) acpi_pcidev_find_dev(struct acpi_devnode *ad)
{ {
struct acpi_pci_info *ap;
struct pci_softc *pci; struct pci_softc *pci;
device_t dv, pr; device_t dv, pr;
deviter_t di; deviter_t di;
if (ap == NULL) if (ad == NULL)
return NULL; return NULL;
if (ad->ad_pciinfo == NULL)
return NULL;
ap = ad->ad_pciinfo;
if (ap->ap_function == 0xFFFF) if (ap->ap_function == 0xFFFF)
return NULL; return NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_pci.h,v 1.7 2010/12/31 10:23:44 jruoho Exp $ */ /* $NetBSD: acpi_pci.h,v 1.8 2010/12/31 10:56:39 jruoho Exp $ */
/* /*
* Copyright (c) 2009 The NetBSD Foundation, Inc. * Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -36,6 +36,6 @@ ACPI_STATUS acpi_pcidev_ppb_downbus(uint16_t, uint16_t, uint16_t,
uint16_t, uint16_t *); uint16_t, uint16_t *);
struct acpi_devnode *acpi_pcidev_find(uint16_t, uint16_t, struct acpi_devnode *acpi_pcidev_find(uint16_t, uint16_t,
uint16_t, uint16_t); uint16_t, uint16_t);
device_t acpi_pcidev_find_dev(struct acpi_pci_info *); device_t acpi_pcidev_find_dev(struct acpi_devnode *);
#endif /* !_SYS_DEV_ACPI_ACPI_PCI_H */ #endif /* !_SYS_DEV_ACPI_ACPI_PCI_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_verbose.c,v 1.13 2010/12/31 10:23:44 jruoho Exp $ */ /* $NetBSD: acpi_verbose.c,v 1.14 2010/12/31 10:56:39 jruoho Exp $ */
/*- /*-
* Copyright (c) 2003, 2007, 2010 The NetBSD Foundation, Inc. * Copyright (c) 2003, 2007, 2010 The NetBSD Foundation, Inc.
@ -65,7 +65,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_verbose.c,v 1.13 2010/12/31 10:23:44 jruoho Exp $"); __KERNEL_RCSID(0, "$NetBSD: acpi_verbose.c,v 1.14 2010/12/31 10:56:39 jruoho Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/device.h> #include <sys/device.h>
@ -458,7 +458,7 @@ static void
acpi_print_tree(struct acpi_devnode *ad, uint32_t level) acpi_print_tree(struct acpi_devnode *ad, uint32_t level)
{ {
struct acpi_devnode *child; struct acpi_devnode *child;
device_t pcidev; device_t dev;
uint32_t i; uint32_t i;
for (i = 0; i < level; i++) for (i = 0; i < level; i++)
@ -490,10 +490,10 @@ acpi_print_tree(struct acpi_devnode *ad, uint32_t level)
ad->ad_pciinfo->ap_segment, ad->ad_pciinfo->ap_segment,
ad->ad_pciinfo->ap_downbus); ad->ad_pciinfo->ap_downbus);
pcidev = acpi_pcidev_find_dev(ad->ad_pciinfo); dev = acpi_pcidev_find_dev(ad);
if (pcidev != NULL) if (dev != NULL)
aprint_normal(" <%s>", device_xname(pcidev)); aprint_normal(" <%s>", device_xname(dev));
} }
aprint_normal("\n"); aprint_normal("\n");