diff options
-rw-r--r-- | include/sound/sdca.h | 4 | ||||
-rw-r--r-- | sound/soc/sdca/sdca_functions.c | 9 |
2 files changed, 4 insertions, 9 deletions
diff --git a/include/sound/sdca.h b/include/sound/sdca.h index 3eea1dfec16c..973252d0adac 100644 --- a/include/sound/sdca.h +++ b/include/sound/sdca.h @@ -23,9 +23,9 @@ struct sdw_slave; * @name: human-readable string */ struct sdca_function_desc { - u64 adr; - u32 type; const char *name; + u32 type; + u8 adr; }; /** diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c index 46aa874bb0aa..a69fdb9c8b15 100644 --- a/sound/soc/sdca/sdca_functions.c +++ b/sound/soc/sdca/sdca_functions.c @@ -108,17 +108,12 @@ static int find_sdca_function(struct acpi_device *adev, void *data) return -EINVAL; } - /* - * The number of functions cannot exceed 8, we could use - * acpi_get_local_address() but the value is stored as u64 so - * we might as well avoid casts and intermediate levels - */ ret = acpi_get_local_u64_address(adev->handle, &addr); if (ret < 0) return ret; - if (!addr) { - dev_err(dev, "no addr\n"); + if (!addr || addr > 0x7) { + dev_err(dev, "invalid addr: 0x%llx\n", addr); return -ENODEV; } |