Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi acpi_pcidev_find_dev(): take struct acpi_devnod...
details: https://anonhg.NetBSD.org/src/rev/2072a0b51274
branches: trunk
changeset: 760223:2072a0b51274
user: jruoho <jruoho%NetBSD.org@localhost>
date: Fri Dec 31 10:56:39 2010 +0000
description:
acpi_pcidev_find_dev(): take struct acpi_devnode as a parameter.
diffstat:
sys/dev/acpi/acpi_pci.c | 14 ++++++++++----
sys/dev/acpi/acpi_pci.h | 4 ++--
sys/dev/acpi/acpi_verbose.c | 12 ++++++------
3 files changed, 18 insertions(+), 12 deletions(-)
diffs (100 lines):
diff -r 3ccdf468d935 -r 2072a0b51274 sys/dev/acpi/acpi_pci.c
--- a/sys/dev/acpi/acpi_pci.c Fri Dec 31 10:23:44 2010 +0000
+++ b/sys/dev/acpi/acpi_pci.c Fri Dec 31 10:56:39 2010 +0000
@@ -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.
@@ -29,7 +29,7 @@
*/
#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/device.h>
@@ -397,15 +397,21 @@
* if it doesn't exist.
*/
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;
device_t dv, pr;
deviter_t di;
- if (ap == NULL)
+ if (ad == NULL)
return NULL;
+ if (ad->ad_pciinfo == NULL)
+ return NULL;
+
+ ap = ad->ad_pciinfo;
+
if (ap->ap_function == 0xFFFF)
return NULL;
diff -r 3ccdf468d935 -r 2072a0b51274 sys/dev/acpi/acpi_pci.h
--- a/sys/dev/acpi/acpi_pci.h Fri Dec 31 10:23:44 2010 +0000
+++ b/sys/dev/acpi/acpi_pci.h Fri Dec 31 10:56:39 2010 +0000
@@ -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.
@@ -36,6 +36,6 @@
uint16_t, uint16_t *);
struct acpi_devnode *acpi_pcidev_find(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 */
diff -r 3ccdf468d935 -r 2072a0b51274 sys/dev/acpi/acpi_verbose.c
--- a/sys/dev/acpi/acpi_verbose.c Fri Dec 31 10:23:44 2010 +0000
+++ b/sys/dev/acpi/acpi_verbose.c Fri Dec 31 10:56:39 2010 +0000
@@ -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.
@@ -65,7 +65,7 @@
*/
#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/device.h>
@@ -458,7 +458,7 @@
acpi_print_tree(struct acpi_devnode *ad, uint32_t level)
{
struct acpi_devnode *child;
- device_t pcidev;
+ device_t dev;
uint32_t i;
for (i = 0; i < level; i++)
@@ -490,10 +490,10 @@
ad->ad_pciinfo->ap_segment,
ad->ad_pciinfo->ap_downbus);
- pcidev = acpi_pcidev_find_dev(ad->ad_pciinfo);
+ dev = acpi_pcidev_find_dev(ad);
- if (pcidev != NULL)
- aprint_normal(" <%s>", device_xname(pcidev));
+ if (dev != NULL)
+ aprint_normal(" <%s>", device_xname(dev));
}
aprint_normal("\n");
Home |
Main Index |
Thread Index |
Old Index