Deleted Added
full compact
acpi_powerres.c (150003) acpi_powerres.c (157947)
1/*-
2 * Copyright (c) 2001 Michael Smith
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Michael Smith
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_powerres.c 150003 2005-09-11 18:39:03Z obrien $");
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_powerres.c 157947 2006-04-21 19:06:29Z jkim $");
29
30#include "opt_acpi.h"
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/malloc.h>
34#include <sys/bus.h>
35
36#include <contrib/dev/acpica/acpi.h>

--- 205 unchanged lines hidden (view full) ---

242acpi_pwr_register_consumer(ACPI_HANDLE consumer)
243{
244 struct acpi_powerconsumer *pc;
245
246 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
247 ACPI_SERIAL_ASSERT(powerres);
248
249 /* Check to see whether we know about this consumer already */
29
30#include "opt_acpi.h"
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/malloc.h>
34#include <sys/bus.h>
35
36#include <contrib/dev/acpica/acpi.h>

--- 205 unchanged lines hidden (view full) ---

242acpi_pwr_register_consumer(ACPI_HANDLE consumer)
243{
244 struct acpi_powerconsumer *pc;
245
246 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
247 ACPI_SERIAL_ASSERT(powerres);
248
249 /* Check to see whether we know about this consumer already */
250 if ((pc = acpi_pwr_find_consumer(consumer)) != NULL)
250 if (acpi_pwr_find_consumer(consumer) != NULL)
251 return_ACPI_STATUS (AE_OK);
252
253 /* Allocate a new power consumer */
254 if ((pc = malloc(sizeof(*pc), M_ACPIPWR, M_NOWAIT)) == NULL)
255 return_ACPI_STATUS (AE_NO_MEMORY);
256 TAILQ_INSERT_HEAD(&acpi_powerconsumers, pc, ac_link);
257 TAILQ_INIT(&pc->ac_references);
258 pc->ac_consumer = consumer;

--- 499 unchanged lines hidden ---
251 return_ACPI_STATUS (AE_OK);
252
253 /* Allocate a new power consumer */
254 if ((pc = malloc(sizeof(*pc), M_ACPIPWR, M_NOWAIT)) == NULL)
255 return_ACPI_STATUS (AE_NO_MEMORY);
256 TAILQ_INSERT_HEAD(&acpi_powerconsumers, pc, ac_link);
257 TAILQ_INIT(&pc->ac_references);
258 pc->ac_consumer = consumer;

--- 499 unchanged lines hidden ---