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 <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/2828205.e9J7NaK4W3@kreacher
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Rafael J. Wysocki 2022-01-26 20:48:49 +01:00 committed by Takashi Iwai
parent 94db9cc8f8
commit ff4865b3c8
2 changed files with 5 additions and 9 deletions

View File

@ -50,11 +50,11 @@ static bool is_link_enabled(struct fwnode_handle *fw_node, int i)
static int static int
sdw_intel_scan_controller(struct sdw_intel_acpi_info *info) sdw_intel_scan_controller(struct sdw_intel_acpi_info *info)
{ {
struct acpi_device *adev; struct acpi_device *adev = acpi_fetch_acpi_dev(info->handle);
int ret, i; int ret, i;
u8 count; u8 count;
if (acpi_bus_get_device(info->handle, &adev)) if (!adev)
return -EINVAL; return -EINVAL;
/* Found controller, find links supported */ /* Found controller, find links supported */
@ -119,7 +119,6 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
void *cdata, void **return_value) void *cdata, void **return_value)
{ {
struct sdw_intel_acpi_info *info = cdata; struct sdw_intel_acpi_info *info = cdata;
struct acpi_device *adev;
acpi_status status; acpi_status status;
u64 adr; u64 adr;
@ -127,7 +126,7 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return AE_OK; /* keep going */ return AE_OK; /* keep going */
if (acpi_bus_get_device(handle, &adev)) { if (!acpi_fetch_acpi_dev(handle)) {
pr_err("%s: Couldn't find ACPI handle\n", __func__); pr_err("%s: Couldn't find ACPI handle\n", __func__);
return AE_NOT_FOUND; return AE_NOT_FOUND;
} }

View File

@ -55,16 +55,13 @@ EXPORT_SYMBOL_GPL(snd_soc_acpi_find_machine);
static acpi_status snd_soc_acpi_find_package(acpi_handle handle, u32 level, static acpi_status snd_soc_acpi_find_package(acpi_handle handle, u32 level,
void *context, void **ret) void *context, void **ret)
{ {
struct acpi_device *adev; struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
acpi_status status; acpi_status status;
struct snd_soc_acpi_package_context *pkg_ctx = context; struct snd_soc_acpi_package_context *pkg_ctx = context;
pkg_ctx->data_valid = false; pkg_ctx->data_valid = false;
if (acpi_bus_get_device(handle, &adev)) if (adev && adev->status.present && adev->status.functional) {
return AE_OK;
if (adev->status.present && adev->status.functional) {
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
union acpi_object *myobj = NULL; union acpi_object *myobj = NULL;