Use acpi_eval_set_integer() to simplify code. No functional change intended.

ok pgoyette@, jmcneill@
This commit is contained in:
jruoho 2010-01-05 13:57:18 +00:00
parent 57bb616085
commit 5bb528f36b
2 changed files with 9 additions and 25 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vald_acpi.c,v 1.30 2009/09/16 10:47:54 mlelstv Exp $ */
/* $NetBSD: vald_acpi.c,v 1.31 2010/01/05 13:57:18 jruoho Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vald_acpi.c,v 1.30 2009/09/16 10:47:54 mlelstv Exp $");
__KERNEL_RCSID(0, "$NetBSD: vald_acpi.c,v 1.31 2010/01/05 13:57:18 jruoho Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -671,20 +671,7 @@ vald_acpi_bcm_set(ACPI_HANDLE handle, UINT32 bright)
static ACPI_STATUS
vald_acpi_dssx_set(UINT32 value)
{
ACPI_STATUS rv;
ACPI_OBJECT Arg;
ACPI_OBJECT_LIST ArgList;
ArgList.Count = 1;
ArgList.Pointer = &Arg;
Arg.Type = ACPI_TYPE_INTEGER;
Arg.Integer.Value = value;
rv = AcpiEvaluateObject(ACPI_ROOT_OBJECT, "\\_SB_.VALX.DSSX",
&ArgList, NULL);
return (rv);
return acpi_eval_set_integer(NULL, "\\_SB_.VALX.DSSX", value);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: mpacpi.c,v 1.81 2010/01/05 13:32:49 jruoho Exp $ */
/* $NetBSD: mpacpi.c,v 1.82 2010/01/05 13:57:18 jruoho Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.81 2010/01/05 13:32:49 jruoho Exp $");
__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.82 2010/01/05 13:57:18 jruoho Exp $");
#include "acpica.h"
#include "opt_acpi.h"
@ -1050,8 +1050,6 @@ int
mpacpi_find_interrupts(void *self)
{
#if NIOAPIC > 0
ACPI_OBJECT_LIST arglist;
ACPI_OBJECT arg;
ACPI_STATUS rv;
#endif
struct acpi_softc *acpi = self;
@ -1073,12 +1071,11 @@ mpacpi_find_interrupts(void *self)
* Switch us into APIC mode by evaluating _PIC(1).
* Needs to be done now, since it has an effect on
* the interrupt information we're about to retrieve.
*
* ACPI 3.0 (section 5.8.1):
* 0 = PIC mode, 1 = APIC mode, 2 = SAPIC mode.
*/
arglist.Count = 1;
arglist.Pointer = &arg;
arg.Type = ACPI_TYPE_INTEGER;
arg.Integer.Value = 1; /* I/O APIC (0 = PIC, 2 = IOSAPIC) */
rv = AcpiEvaluateObject(NULL, "\\_PIC", &arglist, NULL);
rv = acpi_eval_set_integer(NULL, "\\_PIC", 1);
if (ACPI_FAILURE(rv) && rv != AE_NOT_FOUND) {
if (mp_verbose)
printf("mpacpi: switch to APIC mode failed\n");