Skip to content

Commit 86fca92

Browse files
andy-shevrafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent bb69505 commit 86fca92

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

drivers/acpi/bus.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ bool acpi_device_is_first_physical_node(struct acpi_device *adev,
682682
* resources available from it but they will be matched normally using functions
683683
* provided by their bus types (and analogously for their modalias).
684684
*/
685-
struct acpi_device *acpi_companion_match(const struct device *dev)
685+
const struct acpi_device *acpi_companion_match(const struct device *dev)
686686
{
687687
struct acpi_device *adev;
688688

@@ -706,7 +706,7 @@ struct acpi_device *acpi_companion_match(const struct device *dev)
706706
* identifiers and a _DSD object with the "compatible" property, use that
707707
* property to match against the given list of identifiers.
708708
*/
709-
static bool acpi_of_match_device(struct acpi_device *adev,
709+
static bool acpi_of_match_device(const struct acpi_device *adev,
710710
const struct of_device_id *of_match_table,
711711
const struct of_device_id **of_id)
712712
{
@@ -808,7 +808,7 @@ static bool __acpi_match_device_cls(const struct acpi_device_id *id,
808808
return true;
809809
}
810810

811-
static bool __acpi_match_device(struct acpi_device *device,
811+
static bool __acpi_match_device(const struct acpi_device *device,
812812
const struct acpi_device_id *acpi_ids,
813813
const struct of_device_id *of_ids,
814814
const struct acpi_device_id **acpi_id,

drivers/acpi/device_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ int acpi_device_uevent_modalias(const struct device *dev, struct kobj_uevent_env
283283
}
284284
EXPORT_SYMBOL_GPL(acpi_device_uevent_modalias);
285285

286-
static int __acpi_device_modalias(struct acpi_device *adev, char *buf, int size)
286+
static int __acpi_device_modalias(const struct acpi_device *adev, char *buf, int size)
287287
{
288288
int len, count;
289289

drivers/acpi/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int acpi_bus_register_early_device(int type);
119119
/* --------------------------------------------------------------------------
120120
Device Matching and Notification
121121
-------------------------------------------------------------------------- */
122-
struct acpi_device *acpi_companion_match(const struct device *dev);
122+
const struct acpi_device *acpi_companion_match(const struct device *dev);
123123
int __acpi_device_uevent_modalias(const struct acpi_device *adev,
124124
struct kobj_uevent_env *env);
125125

0 commit comments

Comments
 (0)