acpi_gpiobus: Reuse the existing IVAR index for an ACPI handle
ACPI_IVAR_HANDLE is a global index shared across multiple busses, there is no need for a unique constant here. Reviewed by: vexeduxr, imp Differential Revision: https://reviews.freebsd.org/D54155
This commit is contained in:
@@ -401,7 +401,7 @@ acpi_gpiobus_read_ivar(device_t dev, device_t child, int which,
|
||||
struct acpi_gpiobus_ivar *devi = device_get_ivars(child);
|
||||
|
||||
switch (which) {
|
||||
case ACPI_GPIOBUS_IVAR_HANDLE:
|
||||
case ACPI_IVAR_HANDLE:
|
||||
*result = (uintptr_t)devi->handle;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -28,21 +28,8 @@
|
||||
#ifndef __ACPI_GPIOBUS_H__
|
||||
#define __ACPI_GPIOBUS_H__
|
||||
|
||||
#include <sys/bus.h>
|
||||
|
||||
#include <contrib/dev/acpica/include/acpi.h>
|
||||
|
||||
enum acpi_gpiobus_ivars {
|
||||
ACPI_GPIOBUS_IVAR_HANDLE = 10600
|
||||
};
|
||||
|
||||
#define ACPI_GPIOBUS_ACCESSOR(var, ivar, type) \
|
||||
__BUS_ACCESSOR(acpi_gpiobus, var, ACPI_GPIOBUS, ivar, type)
|
||||
|
||||
ACPI_GPIOBUS_ACCESSOR(handle, HANDLE, ACPI_HANDLE)
|
||||
|
||||
#undef ACPI_GPIOBUS_ACCESSOR
|
||||
|
||||
uint32_t acpi_gpiobus_convflags(ACPI_RESOURCE_GPIO *);
|
||||
|
||||
#endif /* __ACPI_GPIOBUS_H__ */
|
||||
|
||||
@@ -208,7 +208,7 @@ gpio_aei_attach(device_t dev)
|
||||
/* This is us. */
|
||||
device_set_desc(dev, "ACPI Event Information Device");
|
||||
|
||||
handle = acpi_gpiobus_get_handle(dev);
|
||||
handle = acpi_get_handle(dev);
|
||||
status = AcpiGetParent(handle, &sc->dev_handle);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
device_printf(dev, "Cannot get parent of %s\n",
|
||||
|
||||
Reference in New Issue
Block a user