| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * apple.c - Apple ACPI quirks |
|---|
| 3 | 4 | * Copyright (C) 2017 Lukas Wunner <lukas@wunner.de> |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License (version 2) as |
|---|
| 7 | | - * published by the Free Software Foundation. |
|---|
| 8 | 5 | */ |
|---|
| 9 | 6 | |
|---|
| 10 | 7 | #include <linux/acpi.h> |
|---|
| .. | .. |
|---|
| 62 | 59 | if (!numprops) |
|---|
| 63 | 60 | goto out_free; |
|---|
| 64 | 61 | |
|---|
| 65 | | - valid = kcalloc(BITS_TO_LONGS(numprops), sizeof(long), GFP_KERNEL); |
|---|
| 62 | + valid = bitmap_zalloc(numprops, GFP_KERNEL); |
|---|
| 66 | 63 | if (!valid) |
|---|
| 67 | 64 | goto out_free; |
|---|
| 68 | 65 | |
|---|
| .. | .. |
|---|
| 132 | 129 | } |
|---|
| 133 | 130 | WARN_ON(free_space != (void *)newprops + newsize); |
|---|
| 134 | 131 | |
|---|
| 135 | | - adev->data.properties = newprops; |
|---|
| 136 | 132 | adev->data.pointer = newprops; |
|---|
| 133 | + acpi_data_add_props(&adev->data, &apple_prp_guid, newprops); |
|---|
| 137 | 134 | |
|---|
| 138 | 135 | out_free: |
|---|
| 139 | 136 | ACPI_FREE(props); |
|---|
| 140 | | - kfree(valid); |
|---|
| 137 | + bitmap_free(valid); |
|---|
| 141 | 138 | } |
|---|