ACPI: bus: Constify acpi_companion_match() returned value

acpi_companion_match() doesn't alter the contents of the passed
parameter, so we don't expect that returned value can be altered
either. So constify it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Andy Shevchenko 2023-06-26 14:00:23 +03:00 committed by Rafael J. Wysocki
parent bb6950556d
commit 86fca926c0
3 changed files with 5 additions and 5 deletions

View File

@ -682,7 +682,7 @@ bool acpi_device_is_first_physical_node(struct acpi_device *adev,
* resources available from it but they will be matched normally using functions * resources available from it but they will be matched normally using functions
* provided by their bus types (and analogously for their modalias). * provided by their bus types (and analogously for their modalias).
*/ */
struct acpi_device *acpi_companion_match(const struct device *dev) const struct acpi_device *acpi_companion_match(const struct device *dev)
{ {
struct acpi_device *adev; struct acpi_device *adev;
@ -706,7 +706,7 @@ struct acpi_device *acpi_companion_match(const struct device *dev)
* identifiers and a _DSD object with the "compatible" property, use that * identifiers and a _DSD object with the "compatible" property, use that
* property to match against the given list of identifiers. * property to match against the given list of identifiers.
*/ */
static bool acpi_of_match_device(struct acpi_device *adev, static bool acpi_of_match_device(const struct acpi_device *adev,
const struct of_device_id *of_match_table, const struct of_device_id *of_match_table,
const struct of_device_id **of_id) const struct of_device_id **of_id)
{ {
@ -808,7 +808,7 @@ static bool __acpi_match_device_cls(const struct acpi_device_id *id,
return true; return true;
} }
static bool __acpi_match_device(struct acpi_device *device, static bool __acpi_match_device(const struct acpi_device *device,
const struct acpi_device_id *acpi_ids, const struct acpi_device_id *acpi_ids,
const struct of_device_id *of_ids, const struct of_device_id *of_ids,
const struct acpi_device_id **acpi_id, const struct acpi_device_id **acpi_id,

View File

@ -283,7 +283,7 @@ int acpi_device_uevent_modalias(const struct device *dev, struct kobj_uevent_env
} }
EXPORT_SYMBOL_GPL(acpi_device_uevent_modalias); EXPORT_SYMBOL_GPL(acpi_device_uevent_modalias);
static int __acpi_device_modalias(struct acpi_device *adev, char *buf, int size) static int __acpi_device_modalias(const struct acpi_device *adev, char *buf, int size)
{ {
int len, count; int len, count;

View File

@ -119,7 +119,7 @@ int acpi_bus_register_early_device(int type);
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Device Matching and Notification Device Matching and Notification
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
struct acpi_device *acpi_companion_match(const struct device *dev); const struct acpi_device *acpi_companion_match(const struct device *dev);
int __acpi_device_uevent_modalias(const struct acpi_device *adev, int __acpi_device_uevent_modalias(const struct acpi_device *adev,
struct kobj_uevent_env *env); struct kobj_uevent_env *env);