Skip to content

Commit ff4865b

Browse files
rafaeljwtiwai
authored andcommitted
ALSA: Replace acpi_bus_get_device()
Replace acpi_bus_get_device() that is going to be dropped with acpi_fetch_acpi_dev(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Link: https://lore.kernel.org/r/2828205.e9J7NaK4W3@kreacher Signed-off-by: Takashi Iwai <[email protected]>
1 parent 94db9cc commit ff4865b

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

sound/hda/intel-sdw-acpi.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ static bool is_link_enabled(struct fwnode_handle *fw_node, int i)
5050
static int
5151
sdw_intel_scan_controller(struct sdw_intel_acpi_info *info)
5252
{
53-
struct acpi_device *adev;
53+
struct acpi_device *adev = acpi_fetch_acpi_dev(info->handle);
5454
int ret, i;
5555
u8 count;
5656

57-
if (acpi_bus_get_device(info->handle, &adev))
57+
if (!adev)
5858
return -EINVAL;
5959

6060
/* Found controller, find links supported */
@@ -119,15 +119,14 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
119119
void *cdata, void **return_value)
120120
{
121121
struct sdw_intel_acpi_info *info = cdata;
122-
struct acpi_device *adev;
123122
acpi_status status;
124123
u64 adr;
125124

126125
status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &adr);
127126
if (ACPI_FAILURE(status))
128127
return AE_OK; /* keep going */
129128

130-
if (acpi_bus_get_device(handle, &adev)) {
129+
if (!acpi_fetch_acpi_dev(handle)) {
131130
pr_err("%s: Couldn't find ACPI handle\n", __func__);
132131
return AE_NOT_FOUND;
133132
}

sound/soc/soc-acpi.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,13 @@ EXPORT_SYMBOL_GPL(snd_soc_acpi_find_machine);
5555
static acpi_status snd_soc_acpi_find_package(acpi_handle handle, u32 level,
5656
void *context, void **ret)
5757
{
58-
struct acpi_device *adev;
58+
struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
5959
acpi_status status;
6060
struct snd_soc_acpi_package_context *pkg_ctx = context;
6161

6262
pkg_ctx->data_valid = false;
6363

64-
if (acpi_bus_get_device(handle, &adev))
65-
return AE_OK;
66-
67-
if (adev->status.present && adev->status.functional) {
64+
if (adev && adev->status.present && adev->status.functional) {
6865
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
6966
union acpi_object *myobj = NULL;
7067

0 commit comments

Comments
 (0)