Commit e254b758 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Danilo Krummrich
Browse files

driver core: make bus_find_device_by_acpi_dev() stub prototype aligned



Currently the bus_find_device_by_acpi_dev() stub for !CONFIG_ACPI case
takes a const void * parameter instead of const struct acpi_device *.
As long as it's a pointer, we may named it as we want to with the help
of a forward declaration. Hence move the declaration out of the
ifdeffery and use the same prototype in both cases. This adds a bit of
an additional type checking at a compilation time.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20251229144325.1252197-1-andriy.shevchenko@linux.intel.com


[ Fix minor typo in the commit message. - Danilo ]
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
parent d88f27d7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -215,9 +215,9 @@ bus_find_next_device(const struct bus_type *bus,struct device *cur)
	return bus_find_device(bus, cur, NULL, device_match_any);
}

#ifdef CONFIG_ACPI
struct acpi_device;

#ifdef CONFIG_ACPI
/**
 * bus_find_device_by_acpi_dev : device iterator for locating a particular device
 * matching the ACPI COMPANION device.
@@ -231,7 +231,7 @@ bus_find_device_by_acpi_dev(const struct bus_type *bus, const struct acpi_device
}
#else
static inline struct device *
bus_find_device_by_acpi_dev(const struct bus_type *bus, const void *adev)
bus_find_device_by_acpi_dev(const struct bus_type *bus, const struct acpi_device *adev)
{
	return NULL;
}