Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Semantics:
details: https://anonhg.NetBSD.org/src/rev/22e2c14aaecd
branches: trunk
changeset: 752548:22e2c14aaecd
user: jruoho <jruoho%NetBSD.org@localhost>
date: Mon Mar 01 05:37:37 2010 +0000
description:
Semantics:
* Use ACPI_ADR_PCI_DEV(x) and ACPI_ADR_PCI_FUNC(x).
* !ACPI_FAILURE -> ACPI_SUCCESS, UINT32 -> uint32_t
* Remove whitespace.
diffstat:
sys/dev/acpi/smbus_acpi.c | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diffs (122 lines):
diff -r e487d30eeb2a -r 22e2c14aaecd sys/dev/acpi/smbus_acpi.c
--- a/sys/dev/acpi/smbus_acpi.c Mon Mar 01 05:26:53 2010 +0000
+++ b/sys/dev/acpi/smbus_acpi.c Mon Mar 01 05:37:37 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbus_acpi.c,v 1.1 2010/02/06 20:10:18 pgoyette Exp $ */
+/* $NetBSD: smbus_acpi.c,v 1.2 2010/03/01 05:37:37 jruoho Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbus_acpi.c,v 1.1 2010/02/06 20:10:18 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbus_acpi.c,v 1.2 2010/03/01 05:37:37 jruoho Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -84,14 +84,14 @@
static int acpi_smbus_match(device_t, cfdata_t, void *);
static void acpi_smbus_attach(device_t, device_t, void *);
-static int acpi_smbus_detach(device_t, int);
+static int acpi_smbus_detach(device_t, int);
static int acpi_smbus_acquire_bus(void *, int);
static void acpi_smbus_release_bus(void *, int);
static int acpi_smbus_exec(void *, i2c_op_t, i2c_addr_t, const void *,
size_t, void *, size_t, int);
static void acpi_smbus_alerts(struct acpi_smbus_softc *);
static void acpi_smbus_tick(void *);
-static void acpi_smbus_notify_handler(ACPI_HANDLE, UINT32, void *);
+static void acpi_smbus_notify_handler(ACPI_HANDLE, uint32_t, void *);
struct SMB_UDID {
uint8_t dev_cap;
@@ -203,7 +203,7 @@
/* Retrieve polling interval for SMBus Alerts */
rv = acpi_eval_struct(aa->aa_node->ad_handle, "_SBI", &smi_buf);
- if (!ACPI_FAILURE(rv)) {
+ if (ACPI_SUCCESS(rv)) {
p = smi_buf.Pointer;
if (p != NULL && p->Type == ACPI_TYPE_PACKAGE &&
p->Package.Count >= 2) {
@@ -242,17 +242,17 @@
* Retrieve and display native controller info
*/
rv = AcpiGetParent(sc->sc_devnode->ad_handle, &native_dev);
- if (!ACPI_FAILURE(rv))
+ if (ACPI_SUCCESS(rv))
rv = AcpiGetParent(native_dev, &native_bus);
- if (!ACPI_FAILURE(rv))
+ if (ACPI_SUCCESS(rv))
rv = AcpiGetObjectInfo(native_bus, &native_bus_info);
- if (!ACPI_FAILURE(rv) &&
+ if (ACPI_SUCCESS(rv) &&
acpi_match_hid(native_bus_info, pcibus_acpi_ids) != 0) {
rv = AcpiGetObjectInfo(native_dev, &native_dev_info);
- if (!ACPI_FAILURE(rv)) {
+ if (ACPI_SUCCESS(rv)) {
pci_bus = native_bus_info->Address;
- pci_dev = (native_dev_info->Address >> 16) & 0xffff;
- pci_func = native_dev_info->Address & 0xffff;
+ pci_dev = ACPI_ADR_PCI_DEV(native_dev_info->Address);
+ pci_func = ACPI_ADR_PCI_FUNC(native_dev_info->Address);
aprint_debug_dev(self, "Native i2c host controller"
" is on PCI bus %d dev %d func %d\n",
pci_bus, pci_dev, pci_func);
@@ -269,11 +269,11 @@
}
static int
-acpi_smbus_detach(device_t self, int flags)
+acpi_smbus_detach(device_t self, int flags)
{
struct acpi_smbus_softc *sc = device_private(self);
ACPI_STATUS rv;
-
+
pmf_device_deregister(self);
callout_halt(&sc->sc_callout, NULL);
@@ -288,7 +288,7 @@
}
mutex_destroy(&sc->sc_i2c_mutex);
-
+
return 0;
}
@@ -296,16 +296,16 @@
acpi_smbus_acquire_bus(void *cookie, int flags)
{
struct acpi_smbus_softc *sc = cookie;
-
+
mutex_enter(&sc->sc_i2c_mutex);
return 0;
-}
-
+}
+
static void
acpi_smbus_release_bus(void *cookie, int flags)
-{
+{
struct acpi_smbus_softc *sc = cookie;
-
+
mutex_exit(&sc->sc_i2c_mutex);
}
static int
@@ -485,7 +485,7 @@
}
static void
-acpi_smbus_notify_handler(ACPI_HANDLE hdl, UINT32 notify, void *opaque)
+acpi_smbus_notify_handler(ACPI_HANDLE hdl, uint32_t notify, void *opaque)
{
device_t dv = opaque;
struct acpi_smbus_softc *sc = device_private(dv);
Home |
Main Index |
Thread Index |
Old Index